home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility3 / vb_kbase.zip / VBKBASE2.TXT < prev   
Text File  |  1991-09-18  |  221KB  |  4,335 lines

  1. Title: Wrong Default Path After Drive Error, VB Open/Add File Dialog 
  2. Document Number: Q72878           Publ Date: 25-JUN-1991 
  3. Product Name: Microsoft Visual Basic 
  4. Product Version:  1.00 
  5. Operating System: WINDOWS 
  6.  
  7.  Summary: 
  8.  When you choose the Open Project or Add File option from the File menu 
  9.  in the VB.EXE environment, and you get an error accessing a disk 
  10.  drive, Visual Basic incorrectly stays logged onto the failed drive 
  11.  path (even though the previous path is displayed), unless you 
  12.  explicitly change the drive. (This behavior differs from the Open 
  13.  command from the File menu in standard Windows applications, such as 
  14.  Microsoft Word for Windows and Microsoft Excel for Windows.) 
  15.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  16.  programming system version 1.0 for Windows. Microsoft is researching 
  17.  this problem and will post new information here as it becomes 
  18.  available. 
  19.  To work around this problem, just change to a valid drive by typing a 
  20.  path preceded by a valid drive letter, or by selecting a valid drive 
  21.  letter with the mouse. 
  22.  More Information: 
  23.  To duplicate this problem, follow these steps: 
  24.  1. Start Visual Basic (such as from the C:\VB\ subdirectory for the 
  25.     following example). 
  26.  2. From the File menu, choose Open Project or Add File. (The Open 
  27.     Project or Add File dialog box lets you search for and select the 
  28.     file you want.) 
  29.  3. Make sure drive A is empty and open. 
  30.  4. Select [-a-| from the dialog box. A message box will correctly 
  31.     appear with the error message "Path Not Found:'' ". (What appears 
  32.     to be one double quotation mark is really two single quotation 
  33.     marks with nothing between them.) 
  34.  5. Choose the OK button. Note that the current path, such as C:\VB 
  35.     (displayed above the Directories box), is correctly shown to be the 
  36.     same as before drive A was selected. The Files and Directories 
  37.     boxes also correctly show the same files as before drive A was 
  38.     selected. (So far, this behavior is the same as for the files 
  39.     dialog box in standard Windows applications.) 
  40.  6. Erase the information in the File Name field, and type the 
  41.     following: 
  42.        *.* 
  43.  7. Choose the OK button. 
  44.  8. The problem is that Visual Basic now incorrectly gives you the 
  45.     "Path Not Found:'' " error message, which demonstrates that the 
  46.     actual current drive fails to match the displayed path (C:\VB), and 
  47.     Visual Basic is incorrectly attempting to access drive A again. 
  48.     This behavior differs from standard Windows applications, such as 
  49.     Microsoft Word for Windows and Excel for Windows, which don't give 
  50.     an error at this point, and instead correctly show all (*.*) files 
  51.     in the path (C:\VB) displayed in the dialog box. 
  52.     To work around this problem, just change to a valid drive by typing 
  53.     a path preceded by a valid drive letter, such as C:\VB\*.*, or by 
  54.     selecting a valid drive letter, such as [-c-| with the mouse. 
  55. Title: Settings Box Is Hidden When Properties Bar at Bottom of Screen
  56. Document Number: Q72881           Publ Date: 25-JUN-1991 
  57. Product Name: Microsoft Visual Basic 
  58. Product Version:  1.00 
  59. Operating System: WINDOWS 
  60.  
  61.  Summary: 
  62.  When the Properties bar is positioned at the bottom of the screen and 
  63.  an enumerated property, such as FontName, is selected from the 
  64.  Settings box, the FontName list is still displayed beneath the 
  65.  Properties bar, instead of above the Properties bar, making the 
  66.  FontName list essentially invisible. Because of this behavior, 
  67.  Microsoft recommends leaving the Properties bar at the top of the 
  68.  screen. 
  69.  Note: The Properties bar's entry field is not a combo box, and does 
  70.  not react as a combo box. 
  71.  This information applies to Microsoft Visual Basic programming system 
  72.  version 1.0 for Windows. 
  73.  More Information: 
  74.  When you open a combo box and the space below is insufficient to 
  75.  display the drop-down list, the list will be displayed above the combo 
  76.  box window. This is exactly how the combo box "Properties list box" 
  77.  displays when the Properties bar is moved to the bottom of the screen. 
  78.  Although the Settings box resembles a combo box, the Settings box is 
  79.  actually an edit box and a push button. This window is not a combo box 
  80.  because the push button can take on several functions. In some cases 
  81.  the Settings box is disabled, and in some cases it invokes a pop-up 
  82.  dialog box (for example, when you select the Picture property of the 
  83.  Picture control). In other cases, such as for the FontName property, 
  84.  the Settings box displays a Windows list box just under the Properties 
  85.  bar. The location of the list box is determined by Visual Basic and 
  86.  will always be displayed below the Properties bar. 
  87.  Microsoft recommends leaving the Properties bar at the top of the 
  88.  screen. 
  89.  Reference: 
  90.  Please refer to pages 38-39 of the "Microsoft Visual Basic: 
  91.  Programmer's Guide" for version 1.0 for definitions of Properties bar, 
  92.  Properties list box, and Settings box. 
  93. Title: Why VB Sub Might Stay in Proc: List Even After Code Deleted 
  94. Document Number: Q73270           Publ Date: 25-JUN-1991 
  95. Product Name: Microsoft Visual Basic 
  96. Product Version:  1.00 
  97. Operating System: WINDOWS 
  98.  
  99.  Summary: 
  100.  In a Visual Basic code window, if you want to delete the code for a 
  101.  Sub...End Sub procedure (or Function...End Function procedure), you 
  102.  must also delete the two or more blank lines (if any) following that 
  103.  procedure, or else that procedure will still exist (in a blank code 
  104.  window and in the Proc: box). 
  105.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  106.  version 1.0 programming system for Windows. We are researching this 
  107.  problem and will post new information here as it becomes available. 
  108.  To work around this problem, make sure to delete all blank lines in 
  109.  the code window for the procedure that you want to delete. 
  110.  More Information: 
  111.  Steps to Reproduce Problem 
  112.  -------------------------- 
  113.  1. Start Visual Basic (or select New Project from Visual Basic's File 
  114.     menu if you are already in Visual Basic). 
  115.  2. Double-click Form1, or press F7, to display the form's Code window. 
  116.  3. Choose (general) from the Object: box, and enter the statement 
  117.     Sub Sub1 in the (general) (declarations) code window, and press the 
  118.     ENTER key. This causes Visual Basic to display the following Sub 
  119.     procedure: 
  120.        Sub Sub1() 
  121.        End Sub 
  122.  4. Press CTRL+END, or click to the blank line after the End Sub 
  123.     statement. 
  124.  5. Press the ENTER key to add a few blank lines after the End Sub 
  125.     statement. 
  126.  6. Using the mouse, select (highlight) from the Sub Sub1() statement 
  127.     to the End Sub statement (but to duplicate the problem, don't 
  128.     highlight the blank lines after the End Sub statement). From the 
  129.     Edit menu, choose Delete, or press the DEL key, to delete the 
  130.     selected text. 
  131.  7. Now the Proc: box still indicates that Sub1 exists as a procedure, 
  132.     even though you just tried to delete it. 
  133.  This problem is caused by the blank lines that were added after the 
  134.  End Sub statement. To work around the problem, highlight and delete 
  135.  the blank lines in the Sub1 code window, and the Sub1 procedure will 
  136.  be properly deleted. 
  137.  Additional reference words: 1.00 
  138. Title: Can't Get Help Within Any VB Dialog Box After an Error 
  139. Document Number: Q73119           Publ Date: 25-JUN-1991 
  140. Product Name: Microsoft Visual Basic 
  141. Product Version:  1.00 
  142. Operating System: MS-DOS 
  143.  
  144.  Summary: 
  145.  If you are in any Visual Basic dialog box and an error occurs, after 
  146.  you dismiss the error message, pressing F1 to get help for the dialog 
  147.  box will result in getting help on the previous error message, not 
  148.  help on the dialog box. 
  149.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  150.  programming system version 1.0 for Windows. We are researching this 
  151.  problem and will post new information here as it becomes available. 
  152.  More Information: 
  153.  The following steps reproduce the error: 
  154.  1. From the File menu, choose Save Project. 
  155.  2. Enter an invalid filename for saving the project. 
  156.  3. An error message will pop up telling you that the filename is 
  157.     incorrect. 
  158.  4. Press ENTER or double-click the OK button to dismiss the error 
  159.     message. 
  160.  5. Press the F1 key to get help on the Save Project dialog box. 
  161.  6. The help message for the error will pop up, instead of help for the 
  162.     dialog box. 
  163.  This behavior is incorrect. The above steps should give you help for 
  164.  the Save Project dialog box. 
  165.  To work around the problem and get correct help on this dialog box, 
  166.  dismiss the incorrect error message by double-clicking the control 
  167.  button, and click CANCEL to get rid of the Save Project dialog box. 
  168.  Now, choose Save Project from the File menu and press F1; the correct 
  169.  help should display. 
  170.  To get help on the error message, press F1 while the error message is 
  171.  displayed. 
  172. Title: "Method Not Applicable..." with IsHidden Method in VB 
  173. Document Number: Q73154           Publ Date: 25-JUN-1991 
  174. Product Name: Microsoft Visual Basic 
  175. Product Version:  1.00 
  176. Operating System: WINDOWS 
  177.  
  178.  Summary: 
  179.  "IsHidden" was a method implemented in prerelease versions of Visual 
  180.  Basic, but IsHidden was removed in the released version (because it 
  181.  was no longer needed). However, using IsHidden as the name for a 
  182.  variable, Sub, Function, or object can still give the following error 
  183.  at run time: 
  184.     Method not applicable with this Object 
  185.  To work around this problem, avoid using the name IsHidden. 
  186.  This information applies to Microsoft Visual Basic programming system 
  187.  version 1.0 for Windows. 
  188.  More Information: 
  189.  The following example demonstrates the problem: 
  190.  1. Within any event procedure, try the following: 
  191.        Sub Form_Click() 
  192.           print ishidden 
  193.        End Sub 
  194.  2. This gives a syntax error asking you to add a "(" to the method, 
  195.     so continue by adding "()": 
  196.        Sub Form_Click() 
  197.           print ishidden() 
  198.        End Sub 
  199.  3. This results in the following format after pressing ENTER after 
  200.     ishidden(): 
  201.        Sub Form_Click() 
  202.           Print IsHidden() 
  203.        Sub End 
  204.     This is the format for a predefined method called IsHidden(). 
  205.  After following the steps above, you will receive a run-time error 
  206.  "Method not applicable with this Object." This error results because 
  207.  this particular method was not completely unimplemented from the beta 
  208.  version. 
  209.  Microsoft will consider completely removing this behavior of the 
  210.  IsHidden name in a future version of Visual Basic. 
  211. Title: Make EXE with 40-Byte Title Displays Only 39 in Task List 
  212. Document Number: Q73155           Publ Date: 25-JUN-1991 
  213. Product Name: Microsoft Visual Basic 
  214. Product Version:  1.00 
  215. Operating System: WINDOWS 
  216.  
  217.  Summary: 
  218.  This information applies to Microsoft Visual Basic programming system 
  219.  version 1.0 for Windows. 
  220.  The following steps demonstrate a problem with Microsoft Windows 3.0; 
  221.  the problem is not caused by Microsoft Visual Basic version 1.0: 
  222.  1. Start Visual Basic. 
  223.  2. From Visual Basic's File Menu, choose the Make EXE File command. 
  224.  3. A Make EXE File dialog box will display. Enter a 40-character 
  225.     filename in the File Name box. 
  226.  4. Double-click the OK command button to exit the dialog box. 
  227.  5. Minimize Visual Basic, go to the Windows Program Manager menu, and 
  228.     choose File. 
  229.  6. From the File menu, choose the Run option; the Run dialog box will 
  230.     display. 
  231.  7. Now enter that 40-character .EXE filename or path to the .EXE 
  232.     filename in the Command Line box, and double-click OK when done. 
  233.  8. The .EXE file will run correctly, but if you press CTRL+ESC to 
  234.     bring up the Task List box, you will see that your .EXE filename 
  235.     has been truncated to 39 characters (it no longer is 40 
  236.     characters). 
  237.  Microsoft has confirmed this problem in the Microsoft Windows version 
  238.  3.0 operating system (buglist3.00). We are researching this problem 
  239.  and will post new information here as it becomes available. 
  240.  Additional reference words: 3.00 
  241. Title: Removing Disk During VB Setup Terminates SETUP, Missing Files 
  242. Document Number: Q73157           Publ Date: 25-JUN-1991 
  243. Product Name: Microsoft Visual Basic 
  244. Product Version:  1.00 
  245. Operating System: WINDOWS 
  246.  
  247.  Summary: 
  248.  While running SETUP.EXE for Visual Basic, you may fail to copy all 
  249.  files (or experience other problems) if you try to remove the disk 
  250.  while the SETUP.EXE program is in progress. 
  251.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  252.  programming system version 1.0 for Windows. We are researching this 
  253.  problem and will post new information here as it becomes available. 
  254.  To work around this problem, wait until SETUP indicates that 100 
  255.  percent of the files are copied before removing the Visual Basic 
  256.  floppy disk. 
  257.  More Information: 
  258.  Below is an example of one specific problem: 
  259.  When running SETUP.EXE on Disk 1 of Visual Basic (using 1.2 MB 5.25- 
  260.  inch disks), you can choose the option to install Visual Basic only. 
  261.  SETUP's bar graph will start by displaying 4 percent done, and while 
  262.  the large file C:\VB\VB.EXE is being copied, the disk drive light may 
  263.  go off and you might assume that Visual Basic is finished running 
  264.  SETUP. At this point you might (mistakenly) remove Disk 1. Then a 
  265.  message tells you that SETUP is complete, and you can exit SETUP. 
  266.  You have now installed VB.EXE, but you did not install some of the 
  267.  other important files, such as VBRUN100.DLL, which is needed to run 
  268.  your compiled applications under Windows version 3.0. 
  269.  If you want to install Visual Basic by selecting Visual Basic only, 
  270.  then you need to let Disk 1 complete its processing by waiting until 
  271.  the bar displays 100 percent. If you let Disk 1 run to completion, 
  272.  then the installed directory C:\VB should correctly contain the 
  273.  following files: 
  274.     VB.EXE 
  275.     VB.HLP 
  276.     VBRUN100.DLL 
  277.     README.TXT 
  278.     PACKING.LST 
  279.     SETUP.EXE 
  280.     DECOMP.DLL 
  281.     CONSTANT.TXT 
  282.  Additional reference words: 1.00 3.00 
  283. Title: Memory Limits in Visual Basic for Windows 
  284. Document Number: Q72879           Publ Date: 26-JUN-1991 
  285. Product Name: Microsoft Visual Basic 
  286. Product Version:  1.00 
  287. Operating System: WINDOWS 
  288.  
  289.  Summary: 
  290.  The following memory limitations apply to Microsoft Visual Basic 
  291.  programming system version 1.0 for Windows. 
  292.  Note: This information only applies when running the retail version of 
  293.  Microsoft Windows version 3.0. Different memory limitations may apply 
  294.  when running Visual Basic under the debug version of Windows provided 
  295.  with the Microsoft Windows Software Development Kit (SDK). 
  296.  More Information: 
  297.  Each Function or Sub procedure can have up to 64K of pseudo code 
  298.  (pcode). 
  299.  Each Form, Module, and Global Module gets its own data segment (up to 
  300.  64K in size) for the allocation of all static data, strings, and 
  301.  simple variables (declared in the General section and Sub and Function 
  302.  procedures). 
  303.  Each array of any data type gets its own data segment, up to 64K in 
  304.  size. Arrays larger than 64K cause a "subscript out of range" error. 
  305.  Huge arrays (arrays larger than 64K) are not directly supported in 
  306.  Visual Basic, but you can support huge arrays through the use of a 
  307.  Windows dynamic-link library (DLL). A separate article discussing 
  308.  support for huge arrays can be found by querying on the following 
  309.  words: 
  310.     huge and array and DLL 
  311.  The properties for all controls on a form and the properties of 
  312.  the form itself go into a single data segment limited to 64K bytes, 
  313.  except the following: 
  314.     The List() property of a List Box 
  315.     The List() property of a Combo Box 
  316.     The Text property of a Text Box 
  317.  The List() property gets its own data segment, limited to 64K bytes, 
  318.  for each List Box and Combo Box. The Text property of a Text Box has a 
  319.  default size limit of 32K, which can be increased to 64K with a call 
  320.  to a Windows API function. For more information on how to increase the 
  321.  amount of text (from 32K to 64K) that can be entered into a Text Box, 
  322.  query on the following words: 
  323.     windows and api and sendmessage and textlimit 
  324.  Other memory limits relating to the properties of Controls and Forms 
  325.  include: 
  326.  1. Each item in the List() property can be up to 1K in size, any item 
  327.     over this limit is truncated. 
  328.  2. The Caption property of a control can be up to 1K in size, any 
  329.     Caption over this limit is truncated. 
  330.  3. The Tag property of a control can be up to 32K in size, any Tag 
  331.     over 32K causes an "out of memory" error. 
  332.  There is one name-and-symbol table up to 32K in size per Form, Module, 
  333.  or Global Module. A name-and-symbol table contains the actual text of 
  334.  Sub function and Sub procedure names, variable names, line numbers, 
  335.  line labels, and an additional 4 bytes overhead for each of these 
  336.  names and symbols. 
  337.  If the 32K size limit is exceeded for a name-and-symbol table, an "out 
  338.  of memory" error will occur. To solve this, break up the Form or 
  339.  Module into multiple Forms or Modules. Note, this cannot be done with 
  340.  the Global Module. Only one Global Module is allowed; if you exhaust 
  341.  the Global Module's name-and-symbol table, there is no workaround, 
  342.  other than to use shorter variable names. 
  343.  The stack is 16K in size, with just one stack per application. The 16K 
  344.  stack size cannot be changed. Note that an "out of stack space" error 
  345.  can easily occur when your program uses uncontrolled recursion. 
  346.  If you run Visual Basic on the debug version of Microsoft 
  347.  Windows provided with the Microsoft Windows SDK, all properties 
  348.  (including List() and Text properties) go into a single segment, up to 
  349.  64K in size per Form or Module. Other memory management limits may 
  350.  also differ under the debug version of Microsoft Windows. The debug 
  351.  version of Windows is created by copying a set of dynamic-link library 
  352.  (DLL) files from the Windows SDK into your \WINDOWS\SYSTEM 
  353.  subdirectory. These special DLLs perform additional error checking, 
  354.  including a check for stack overflow. 
  355. Title: Code Causing Run-Time Error Can Be Hidden If in Split Window 
  356. Document Number: Q73156           Publ Date: 26-JUN-1991 
  357. Product Name: Microsoft Visual Basic 
  358. Product Version:  1.00 
  359. Operating System: WINDOWS 
  360.  
  361.  Summary: 
  362.  Under certain circumstances, using a split window in the Visual Basic 
  363.  environment can hide the code, which results in a run-time error. 
  364.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  365.  programming system version 1.0 for Windows. We are researching this 
  366.  problem and will post new information here as it becomes available. 
  367.  To work around the problem, use step 8 shown below. 
  368.  More Information: 
  369.  The following example demonstrates a problem using split screens 
  370.  in Microsoft Visual Basic programming system version 1.0 for Windows: 
  371.  1. Start Visual Basic, and from the File menu choose New Project. 
  372.  2. Using the mouse, double-click on Form1; the Code window will 
  373.     display. 
  374.  3. From the Code window, press the Maximize button so the entire 
  375.     screen displays Form1's Code window. 
  376.  4. Select the split window bar, and click and drag the split 
  377.     window down to about two inches from the bottom of the screen. 
  378.  5. The Sub Form_Click() should be displayed in the lower half of the 
  379.     split window. Enter the following code: 
  380.        Sub Form_Click() 
  381.                        Print 1/0     'enter this line 
  382.        End Sub 
  383.  6. Now run the sample code by choosing Start from the Run menu or 
  384.     by pressing the F5 function key. 
  385.  7. After choosing Start from the Run Menu, click the Form1 window; 
  386.     a "Division by zero" error will display. The error occurs because 
  387.     of the "Print 1/0" statement coded above, but you cannot see the 
  388.     line of code where the error occurred. 
  389.  8. If you click on the Maximize button for FORM1.FRM, you will see that 
  390.     the error occurs on the Print 1/0 statement. Use this method to work 
  391.     around the problem. 
  392. Title: VB Replace Command Using Verify Can Incorrectly Repeat Replace 
  393. Document Number: Q73271           Publ Date: 26-JUN-1991 
  394. Product Name: Microsoft Visual Basic 
  395. Product Version:  1.00 
  396. Operating System: WINDOWS 
  397.  
  398.  Summary: 
  399.  This article discusses a problem with the Verify option of the Code 
  400.  menu's Replace command in the Microsoft Visual Basic version 1.0 
  401.  editor. If the search string is a subset of the replacement string, 
  402.  and if the Visual Basic syntax parser automatically inserts a space in 
  403.  the replacement string, then the Replace command with Verify 
  404.  incorrectly repeats the Replace on text that was part of the 
  405.  replacement string itself. 
  406.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  407.  version 1.0 programming system for Windows. Microsoft is researching 
  408.  this problem and will post new information here as it becomes 
  409.  available. 
  410.  To work around the problem, you can manually put space that would be 
  411.  inserted by the syntax parser in the replacement string (as described 
  412.  below). The problem does not occur with the Replace All option. 
  413.  More Information: 
  414.  Steps to Reproduce Problem 
  415.  -------------------------- 
  416.  1. Start Visual Basic (or select New Project from Visual Basic's File 
  417.     menu). 
  418.  2. From the Project1 window, double-click GLOBAL.BAS. This displays the 
  419.     Global module window. (Note that this Replace problem can occur in 
  420.     any code window.) 
  421.  3. In the Global module window, enter the following code: 
  422.        Global A(2) 
  423.     [Or enter Dim A(2) in the code window of any non-Global module.| 
  424.  4. Now choose the Replace command from the Code menu. 
  425.  5. The Replace window contains two text boxes named "Find What:" and 
  426.     "Replace With:". In the Find What text box, enter a ")" and then 
  427.     tab to the Replace With text box and enter ",2)". 
  428.  6. Choose the Verify command button. 
  429.  7. The Verify window prompts you with "Replace Selected Text" [Yes| or 
  430.     [No|. If you choose the Yes command button, the replacement 
  431.     occurs correctly. The problem doesn't occur until you choose the 
  432.     Yes command button for a second time (and third, and so on), which 
  433.     will incorrectly add another string of text at the same location. 
  434.  The problem is caused by the space that the Visual Basic parser 
  435.  automatically inserts after the comma. This causes Visual Basic to 
  436.  effectively start the next search one character too early, causing the 
  437.  search to find the ")" that was just inserted. The problem can be 
  438.  avoided by changing the Replace string to ", 2)" (with a space after 
  439.  the comma). 
  440.  You can also avoid the problem by choosing the "Replace All" command 
  441.  button instead of the Verify command button (mentioned in step 6 
  442.  above). This correctly does the Replace and displays the "Search 
  443.  complete" window. 
  444.  You can also avoid the problem by selecting the No command button the 
  445.  second time the Verify window is displayed (in step 7) (and then 
  446.  choose the OK command button when the "Search complete" window 
  447.  displays). 
  448. Title: Can't Use Multiple & (for Access Keys) in a VB Menu Control 
  449. Document Number: Q73372           Publ Date: 26-JUN-1991 
  450. Product Name: Microsoft Visual Basic 
  451. Product Version:  1.00 
  452. Operating System: WINDOWS 
  453.  
  454.  Summary: 
  455.  When creating a menu control that has multiple & (ampersand) 
  456.  characters to mark the access keys in the caption (for example, 
  457.  &a&b&c&d), the menu will appear with an underline under the character 
  458.  after the last &. However, the access key will respond to the 
  459.  character following the first &. This is not a problem with Visual 
  460.  Basic, but rather with the Windows operating environment. 
  461.  This information applies to the Microsoft Visual Basic programming 
  462.  system version 1.0 for Windows. 
  463.  To work around this problem, do not put multiple & characters in the 
  464.  menu caption; just use one & character per caption. 
  465.  More Information: 
  466.  Steps to Reproduce Problem 
  467.  -------------------------- 
  468.  1. From the File menu, choose New Project (ALT+F+N). 
  469.  2. From the Window menu, choose Menu Design Window (ALT+W+M). 
  470.  3. Enter "&A&B&C&D" (without the quotation marks) for the Caption. 
  471.  4. Enter "ABCD" (without the quotation marks) for the CtlName. 
  472.  5. Choose the Done button. 
  473.  6. Click on the menu item ABCD on Form1. 
  474.  7. Enter the statement Print "ABCD" in the click event for the menu 
  475.     item ABCD as follows: 
  476.              Sub ABCD_Click () 
  477.                  Print "ABCD" 
  478.              End Sub 
  479.  8. Run the program. 
  480.  When the program is run, the D in the menu caption will be underlined, 
  481.  but the menu responds to ALT+A, not ALT+D. 
  482. Title: UAE Placing More than 64K in VB List Box or Combo Box 
  483. Document Number: Q73374           Publ Date: 26-JUN-1991 
  484. Product Name: Microsoft Visual Basic 
  485. Product Version:  1.00 
  486. Operating System: WINDOWS 
  487.  
  488.  Summary: 
  489.  Attempting to add more than 64K of data into a Visual Basic list box 
  490.  or combo box will result in a Windows UAE (unrecoverable application 
  491.  error). 
  492.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  493.  programming system version 1.0 for Windows. Microsoft is researching 
  494.  this problem and will post new information here as it becomes 
  495.  available. 
  496.  More Information: 
  497.  Each item of a list box or combo box can contain a string up to 1K in 
  498.  length; however, if the total of all items exceeds 64K, a UAE will be 
  499.  generated. The .List() property for list boxes and combo boxes is 
  500.  given its own segment up to 64K in size. If an attempt to exceed this 
  501.  limit is made, an "Out of memory" or "Out of string space" error 
  502.  message should result, but instead a UAE occurs and the program 
  503.  terminates. 
  504.  Steps to Reproduce Problem 
  505.  -------------------------- 
  506.  1. Create a New Project. 
  507.  2. Draw a list box on Form1. 
  508.  3. Add the following code to Form1's Click() event procedure: 
  509.          Sub Form_Click() 
  510.              Do 
  511.                  List1.Additem String$(1024, "X") 
  512.                  I = I + 1 
  513.                  Debug.Print I 
  514.              Loop 
  515.          End Sub 
  516.  When the UAE occurs, note that the value of the variable "I" displayed 
  517.  in the Immediate window will be 63. The UAE occurred when adding the 
  518.  64th item, which caused the total size of the data in the list box to 
  519.  exceed 64K. The actual limit is slightly under 64K due to a small 
  520.  amount of overhead to manage the .List() property because it is a 
  521.  property array. 
  522. Title: VB Cls Method on Thin and Wide Picture Control May Give UAE 
  523. Document Number: Q73375           Publ Date: 26-JUN-1991 
  524. Product Name: Microsoft Visual Basic 
  525. Product Version:  1.00 
  526. Operating System: MS-DOS 
  527.  
  528.  Summary: 
  529.  Performing a Cls method on a picture control can generate a UAE 
  530.  (unrecoverable application error) message under the following 
  531.  conditions: 
  532.  1. AutoRedraw = TRUE for the picture control. 
  533.  2. The .Width property for the picture control is very large 
  534.     (approximately 20 times the width of the screen if running Windows 
  535.     with a 256-color video driver, or approximately 40 times the width of 
  536.     the screen if running Windows with a 16-color video driver.) 
  537.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  538.  programming system version 1.0 for Windows. Microsoft is researching 
  539.  this problem and will post new information here as it becomes 
  540.  available. 
  541.  More Information: 
  542.  Steps to Reproduce Problem 
  543.  -------------------------- 
  544.  1. Start Windows using a 256-color driver and run Visual Basic 
  545.     (VB.EXE). 
  546.  2. Create a New Project and place a picture control on the form. 
  547.  3. Add the following code to the Form_Click procedure: 
  548.    Sub Form_Click() 
  549.        Form1.ScaleMode = 3      ' PIXEL's 
  550.        Picture1.AutoRedraw = -1 
  551.        Picture1.Height = 34     ' 64 for 16 color video driver 
  552.        For i% = 380 To 390 
  553.            Picture1.Width = Picture1.Height * i% 
  554.            Picture1.Cls 
  555.            Debug.Print Picture1.Width 
  556.        Next i% 
  557.    End Sub 
  558.  4. Press F5 to run the program. You will now receive a Windows 
  559.     UAE message. 
  560.     Note the value of Picture1.Width at the time of the UAE. It 
  561.     should be approximately 20 times the width of your current screen 
  562.     resolution. 
  563. Title: Clicking on Toolbox/Color Palette Menu Doesn't Leave Menu Open 
  564. Document Number: Q73418           Publ Date:  1-JUL-1991 
  565. Product Name: Microsoft Visual Basic 
  566. Product Version:  1.00 
  567. Operating System: WINDOWS 
  568.  
  569.  Summary: 
  570.  When you single click in the System menu (the Control menu in the 
  571.  upper left corner) of the Toolbox or the Color Palette in the Visual 
  572.  Basic environment, the menu flashes on the screen but does not stay 
  573.  visible like normal Windows System menus. This is by design. 
  574.  To keep the Toolbox or Color Palette system menu pulled down, you must 
  575.  hold down the mouse button. 
  576.  This information applies to Microsoft Visual Basic programming system 
  577.  version 1.0 for Windows. 
  578.  More Information: 
  579.  On a normal Windows System menu, a single mouse click pulls down the 
  580.  menu and keeps the menu down without having to hold down the mouse 
  581.  button. Even though the System menus of the Toolbox and Color Palette 
  582.  may look like normal System menus, they do not act like them, and are 
  583.  not "normal" Windows System menus. They were not designed to stay open 
  584.  with a single mouse click; therefore, the menu will flash briefly on 
  585.  the screen on a single mouse click and then disappear, unless you keep 
  586.  the mouse button held down. 
  587. Title: VB Repaint Problem at Design Time with > 50 Controls on Form 
  588. Document Number: Q73505           Publ Date:  1-JUL-1991 
  589. Product Name: Microsoft Visual Basic 
  590. Product Version:  1.00 
  591. Operating System: WINDOWS 
  592.  
  593.  Summary: 
  594.  If a combination of more than 50 text boxes and text labels are placed 
  595.  on a form, the form may be repainted incorrectly. The usual result is 
  596.  that the grid points are lost, the title bar and border are missing, 
  597.  and portions of the controls are missing. This is a problem that 
  598.  occurs at design time in the Visual Basic development environment. The 
  599.  problem does not apply to a program that is run in the Visual Basic 
  600.  environment or run as a .EXE program. 
  601.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  602.  programming system version 1.0 for Windows. We are researching this 
  603.  problem and will post new information here as it becomes available. 
  604.  This problem has only been observed with text boxes and labels. Other 
  605.  controls on the form (command buttons, picture boxes, and so on) 
  606.  repaint correctly. 
  607.  More Information: 
  608.  The following steps may reproduce the error on some machine 
  609.  configurations: 
  610.  1. Create a new form and place 50 text boxes and/or labels on the 
  611.     form. 
  612.  2. Double-click on one of the controls to bring up its code window. 
  613.  3. Make sure the code window covers most of the form, then close the 
  614.     code window by double-clicking on its control box. 
  615.  4. The grid points, title bar, and border may be missing on the 
  616.     repainted form. 
  617.  To repaint the form correctly, position the mouse pointer above where 
  618.  the title bar should be, hold down the left button, and move the form 
  619.  window. This will bring back the title bar and border. To get the grid 
  620.  points back, choose Grid Settings from the Edit menu, make sure the 
  621.  Show Grid option is enabled, then choose OK. Your form should now be 
  622.  repainted correctly. 
  623. Title: Large Grid Settings Can Make Moving Controls Difficult 
  624. Document Number: Q73506           Publ Date:  1-JUL-1991 
  625. Product Name: Microsoft Visual Basic 
  626. Product Version:  1.00 
  627. Operating System: WINDOWS 
  628.  
  629.  Summary: 
  630.  The Align to Grid feature in the Edit menu in the Microsoft Visual 
  631.  Basic environment can sometimes prevent you from moving a text box 
  632.  control. 
  633.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  634.  programming system version 1.0 for Windows. Microsoft is researching 
  635.  this problem and will post new information here as it becomes 
  636.  available. 
  637.  More Information: 
  638.  Steps to Reproduce Problem 
  639.  -------------------------- 
  640.  1. From the Edit menu, choose Grid Settings. Set the grid settings as 
  641.     follows: 
  642.          Width: 1485    Height: 1485    Show Grid ON    Align to Grid ON 
  643.  2. Add a text box control and move it so that the top of the text box 
  644.     is even with the second row of the grid (the first row is even with 
  645.     the top of the form). 
  646.  3. Select the top half of the text box and try to move it up to the 
  647.     row above. In most instances, you will not be able to move the text 
  648.     box to the desired location. 
  649. Title: Overlapping Controls Not Supported in Visual Basic 
  650. Document Number: Q73651           Publ Date:  2-JUL-1991 
  651. Product Name: Microsoft Visual Basic 
  652. Product Version:  1.00 
  653. Operating System: WINDOWS 
  654.  
  655.  Summary: 
  656.  Overlapping Visual Basic controls may not respond as expected to mouse 
  657.  events. For example, the bottom control will receive the mouse event 
  658.  even when it appears that you have selected the top control. The use 
  659.  of overlapping Controls is not supported in Microsoft Visual Basic 
  660.  version 1.0. 
  661.  This information applies to the Microsoft Visual Basic programming 
  662.  system version 1.0 for Windows. 
  663.  More Information: 
  664.  Although the Visual Basic design editor allows you to overlap 
  665.  controls, when you run the application the region of the controls that 
  666.  overlap may not function as you would expect. 
  667.  For example, if two Command buttons, Command1 and Command2, overlap so 
  668.  that Command1 is partially on top of Command2, when you select 
  669.  Command1 within the region of overlap you would expect a Click event 
  670.  to be issued for Command1. However, the Click event may occur on 
  671.  Command2 even though it is underneath Command1 in the overlapping region.
  672. Title: UAE Exiting Windows when VB Form1 Unload Event Unloads Form2 
  673. Document Number: Q73656           Publ Date:  2-JUL-1991 
  674. Product Name: Microsoft Visual Basic 
  675. Product Version:  1.00 
  676. Operating System: WINDOWS 
  677.  
  678.  Summary: 
  679.  A Windows "Unrecoverable Application Error" (UAE) message will occur 
  680.  if you terminate Microsoft Windows 3.0 under the following conditions: 
  681.  1. A Visual Basic version 1.0 application is resident (running in the 
  682.     background or foreground). 
  683.  2. The Visual Basic application contains multiple forms. 
  684.  3. The Unload event procedure of one form unloads another form. 
  685.  4. The Visual Basic application is compiled and run as an .EXE program. 
  686.  This problem does not occur when you run the program from the Visual 
  687.  Basic development environment. 
  688.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  689.  programming system version 1.0 for Windows. We are researching this 
  690.  problem and will post new information here as it becomes available. 
  691.  More Information: 
  692.  Steps to Reproduce Problem 
  693.  -------------------------- 
  694.  1. Start Visual Basic, and Form1 will automatically be created by 
  695.     default. (If you already have a project loaded in the Visual Basic 
  696.     environment, you can select New Project from the File menu 
  697.     [ALT+F, N|.) 
  698.  2. From the File menu, choose New Form. This will create Form2. 
  699.  3. Add the following code to Form1's Load event procedure: 
  700.          Sub Form_Load () 
  701.               Form2.Show 
  702.          End Sub 
  703.  4. Add the following code to Form1's Unload event procedure: 
  704.          Sub Form_Unload (Cancel As Integer) 
  705.               Unload Form2 
  706.          End Sub 
  707.  5. From the File menu, choose Make EXE File (ALT+F, K) to create an 
  708.     .EXE file. 
  709.  6. From the Windows Program Manager's File menu, choose the Run 
  710.     option, and run the Visual Basic .EXE program that you just 
  711.     created. 
  712.  7. Terminate Windows (ALT+F, X from the Windows Program Manager). The 
  713.     Windows UAE message occurs. The computer may hang after you click on 
  714.     the OK button of the UAE dialog box. 
  715.  The UAE message incorrectly occurs because of the attempt to unload 
  716.  Form2 from Form1's Unload event procedure. This is a known problem 
  717.  when attempting to use the Unload method for one form from within the 
  718.  Unload event procedure of another form. 
  719.  To work around this problem, remove the Unload method from the Unload 
  720.  event procedure or use the End statement in the Unload event procedure 
  721.  instead. 
  722. Title: Determining Number of Lines in VB Text Box; SendMessage API 
  723. Document Number: Q72719           Publ Date:  8-JUL-1991 
  724. Product Name: Microsoft Visual Basic 
  725. Product Version:  1.00 
  726. Operating System: WINDOWS 
  727.  
  728.  Summary: 
  729.  To determine the number of lines of text within a text box control, 
  730.  call the Windows API function SendMessage with EM_GETLINECOUNT(&H40A) 
  731.  as the wMsg argument. 
  732.  Calling SendMessage with the following parameters will return the 
  733.  amount of lines of text within a text box: 
  734.     hWd%   - Handle to the text box. 
  735.     wMsg%   - EM_GETLINECOUNT(&H40A) 
  736.     wParam% - 0 
  737.     lParam% - 0 
  738.  This information applies to Microsoft Visual Basic programming 
  739.  system version 1.0 for Windows. 
  740.  More information: 
  741.  As an example to determine the amount of lines within a text box, 
  742.  perform the following: 
  743.  1. Create a form with a text box and a command button. Change the 
  744.     MultiLine property of the text box to TRUE. 
  745.  2. Declare the API SendMessage function in the global-declarations 
  746.     section of your code window. (the Declare statement must be 
  747.     on just one line): 
  748.        Declare Function SendMessage% Lib "user" (ByVal hWd%, 
  749.                                                  ByVal wMsg%, 
  750.                                                  ByVal wParam%, 
  751.                                                  ByVal lParam&) 
  752.  3. You will need to declare another API routine to get the handle of 
  753.     the text box. Declare this also in your global-declarations section 
  754.     of your code window. The returned value will become the hWd% 
  755.     argument to the SendMessage function. 
  756.        Declare Function GetFocus% Lib "user" () 
  757.  4. Within the click event of your button, add the following code: 
  758.        Sub Command1_Click () 
  759.           Const EM_GETLINECOUNT = &H40A  'defined within SDK WINDOWS.H 
  760.           ' command button has focus, give focus to text box. 
  761.           Text1.SetFocus 
  762.           ' get the handle of the text box. 
  763.           hWd% = GetFocus() 
  764.           ' print the amount of lines to the immediate window. 
  765.           Debug.Print SendMessage(hWd%, EM_GETLINECOUNT, 0, 0) 
  766.        End Sub 
  767.  5. Run the program. Add several lines of text to the text box. Click 
  768.     the command button to see the number of lines printed out to the 
  769.     immediate window. 
  770.  References: 
  771.  "Programming Windows: the Microsoft Guide to Writing Applications for 
  772.  Windows 3," by Charles Petzold (published by Microsoft Press, 1990) 
  773.  "Peter Norton's Windows 3.0 Power Programming Techniques," by Peter 
  774.  Norton and Paul Yao (published by Bantam Computer Books, 1990) 
  775.  "Microsoft Windows 3.0 Software Development Kit: Reference Volume 1" 
  776.  The WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  777.  Development Kit 
  778. Title: How to Make a VB Text Box Control with a Password (*) Style 
  779. Document Number: Q71457           Publ Date: 16-JUL-1991 
  780. Product Name: Microsoft Visual Basic 
  781. Product Version:  1.00 
  782. Operating System: WINDOWS 
  783.  
  784.  Summary: 
  785.  In the password style for a control, all characters display as an 
  786.  asterisk (*) as they are typed into the control. Microsoft Visual 
  787.  Basic does not have any intrinsic function for creating an edit 
  788.  control with the password style. You can add the password style to a 
  789.  Visual Basic text box control by using several Windows API function 
  790.  calls. 
  791.  This information applies to Microsoft Visual Basic Programming System 
  792.  version 1.0 for Windows. 
  793.  More Information: 
  794.  Adding the password style to a text box control can be performed by 
  795.  calling several Windows API function calls. These functions are 
  796.  GetFocus, GetWindowLong, SetWindowLong, and SendMessage. 
  797.  The function GetFocus requires no parameters. This function returns an 
  798.  integer value that represents the handle to the control. Use GetFocus 
  799.  to get a handle to the control that currently has the focus. 
  800.     hWd% = GetFocus() 
  801.  After you have received the handle to the text box control, you can 
  802.  call GetWindowLong to retrieve the style flags for the control by 
  803.  using the second parameter of GWL_STYLE. Once you have the style 
  804.  flags, you can use the bit-wise OR operation to set the ES_PASSWORD 
  805.  style. 
  806.     StyleFlags& = GetWindowLong (hWd%, GWL_STYLE) 
  807.     StyleFlags& = StyleFlags& OR ES_PASSWORD 
  808.  After adding the password style to the existing style for the control, 
  809.  you can call SetWindowLong to change the style associated to the 
  810.  control. You would call SendMessage with the message parameter of 
  811.  ES_SETPASSWORDCHAR to inform the control what character is to be used 
  812.  as the password mask; the default character is an asterisk (*). 
  813.     StyleFlags& = SetWindowLong (hWd%, GWL_STYLE, StyleFlags&) 
  814.     PasswordMask% = Asc("*") 
  815.     SendMessage (hWd%, ES_SETPASSWORDCHAR, PasswordMask%, 0&) 
  816.  To create a text box with the password style within Visual Basic, 
  817.  create a text box with the name Text1 on Form1. 
  818.  Declare the following Windows API functions and CONST variables in the 
  819.  Global section of your code: 
  820.  Declare Function GetFocus Lib "User" () As Integer 
  821.  Declare Function GetWindowLong Lib "User" (ByVal hWd%, ByVal nIndex%) 
  822.                                   As Long 
  823.  Declare Function SetWindowLong Lib "User" (ByVal hWd%, ByVal nIndex%, 
  824.                                   ByVal dwNewLong&) As Long 
  825.  Declare Function SendMessage Lib "User" (ByVal hWd%, ByVal wMsg%, 
  826.                                   ByVal wParam%, ByVal lParam&) As Long 
  827.  Global Const WM_USER = &H400 
  828.  Global Const EM_SETPASSWORDCHAR = WM_USER + 28 
  829.  Global Const ES_PASSWORD = &H20 
  830.  Global Const GWL_STYLE = -16 
  831.  Note: Each Declare statement above must be written on just one line. 
  832.  Include the following code in the (general) section of the Form1 
  833.  module: 
  834.  Sub Make_Password_Control (Flag As Integer, PasswordMask As Integer) 
  835.      Dim hWd As Integer     ' Window Handle for the control 
  836.      Dim StyleFlags As Long    ' Window Style for the control 
  837.      If Not Flag Then 
  838.          ' The control should have a STATIC flag to minimize the 
  839.          ' execution of the code.  We don't want to perform this code 
  840.          ' all the time, just once. 
  841.          Flag = Not Flag 
  842.          hWd = GetFocus() 
  843.          StyleFlags = GetWindowLong(hWd, GWL_STYLE) 
  844.          StyleFlags = StyleFlags Or ES_PASSWORD 
  845.          StyleFlags = SetWindowLong(hWd, GWL_STYLE, StyleFlags) 
  846.          StyleFlags = SendMessage(hWd, EM_SETPASSWORDCHAR, PasswordMask, 0&) 
  847.      End If 
  848.  End Sub 
  849.  Include the following code in the Text1_GotFocus event in the Form1 
  850.  module: 
  851.  Sub Text1_GotFocus () 
  852.      Static Already_Password As Integer 
  853.      Make_Password_Control Already_Password, Asc("*") 
  854.  End Sub 
  855. Title: How to Get "HWnd" Handle for a Control by Using GetFocus API 
  856. Document Number: Q71799           Publ Date: 16-JUL-1991 
  857. Product Name: Microsoft Visual Basic 
  858. Product Version:  1.00 
  859. Operating System: WINDOWS 
  860.  
  861.  Summary: 
  862.  Microsoft Visual Basic does not provide access to the Windows Handle 
  863.  (hWnd) for any control other than the Form. By using the Windows API 
  864.  GetFocus function, you can retrieve the handle to most Visual Basic 
  865.  controls. 
  866.  This information applies to Microsoft Visual Basic Programming System 
  867.  version 1.00 for Windows. 
  868.  More Information: 
  869.  Visual Basic provides a "hWnd" property for the Form, but none of the 
  870.  provided controls has this property. By using the Windows API GetFocus 
  871.  function and the Visual Basic SetFocus method you can obtain the 
  872.  "hWnd" for most Visual Basic controls. With the exception of the Frame 
  873.  and Label controls, neither of these controls can receive the focus 
  874.  for user input and do not support the Visual Basic SetFocus method. 
  875.  The Visual Basic SetFocus method allows the changing of the input 
  876.  focus to a specific control, rather then waiting for the user to 
  877.  select the desired control manually. The following code will change 
  878.  the focus to the Command Button "Command1" on the Form: 
  879.     Command1.SetFocus 
  880.  The GetFocus function requires no parameters. The GetFocus function 
  881.  returns an integer value that represents the handle to the control. 
  882.  Use GetFocus to get a handle to the control that currently has the 
  883.  focus: 
  884.     hWd% = GetFocus()  ' HWnd is reserved word in Visual Basic, so you 
  885.                        ' must use a different name, such as hWd% 
  886.  Most Windows API functions require the handle (hWnd) of the window 
  887.  that is to be acted upon. 
  888.  For examples of using the Windows API GetFocus function in Visual 
  889.  Basic, query on the following word: 
  890.     GETFOCUS 
  891. Title: "Overflow" in VB Drawing Circle Segment with Radius of Zero 
  892. Document Number: Q73280           Publ Date: 16-JUL-1991 
  893. Product Name: Microsoft Visual Basic 
  894. Product Version:  1.00 
  895. Operating System: MS-DOS 
  896.  
  897.  Summary: 
  898.  When using the Microsoft Visual Basic version 1.0 Circle statement to 
  899.  draw a segment of a circle with a radius of 0, an "Overflow" error 
  900.  incorrectly occurs. 
  901.  Microsoft has confirmed this to be a problem with Microsoft Visual 
  902.  Basic programming system version 1.0 for Windows. We are researching 
  903.  the problem and will post new information here as it becomes 
  904.  available. 
  905.  More Information: 
  906.  The following statement demonstrates the problem: 
  907.     Circle (0,0), 0,, 4, 5 
  908.  When you run the above statement, an "Overflow" error incorrectly 
  909.  occurs. 
  910.  In contrast, using the Circle statement to draw an entire circle of 
  911.  radius 0 works correctly without an error (correctly drawing nothing); 
  912.  for example: 
  913.     Circle (0,0), 0 
  914. Title: How to Scroll VB Text Box Programmatically and Specify Lines 
  915. Document Number: Q73371           Publ Date: 16-JUL-1991 
  916. Product Name: Microsoft Visual Basic 
  917. Product Version:  1.00 
  918. Operating System: WINDOWS 
  919.  
  920.  Summary: 
  921.  By making a call to the Windows API function SendMessage, you can 
  922.  scroll text a specified number of lines or columns within a Visual 
  923.  Basic text box. By using SendMessage, you can also scroll text 
  924.  programmatically, without user interaction. This technique extends 
  925.  Visual Basic's scrolling functionality beyond the built-in statements 
  926.  and methods. The sample program below shows how to scroll text 
  927.  vertically and horizontally a specified number of lines. 
  928.  This information applies to Microsoft Visual Basic programming system 
  929.  version 1.0 for Windows. 
  930.  More Information: 
  931.  Note that Visual Basic itself does not offer a statement for scrolling 
  932.  text a specified number of lines vertically or horizontally within a 
  933.  text box. You can scroll text vertically or horizontally by actively 
  934.  clicking on the vertical and horizontal scroll bars for the text box 
  935.  at run time; however, you do not have any control over how many lines 
  936.  or columns are scrolled for each click of the scroll bar. Text always 
  937.  scrolls one line or one column per click on the scroll bar. 
  938.  Furthermore, no built-in Visual Basic method can scroll text without 
  939.  user interaction. To work around these limitations, you can call the 
  940.  Windows API function SendMessage, as explained below. 
  941.  Example 
  942.  ------- 
  943.  To scroll the text a specified number of lines within a text box 
  944.  requires a call to the Windows API function SendMessage using the 
  945.  constant EM_LINESCROLL. You can invoke the SendMessage function from 
  946.  Visual Basic as follows: 
  947.  r& = SendMessage& (hWd%, EM_LINESCROLL, wParam%, lParam&) 
  948.       hWd%    The window handle of the text box. 
  949.       wParam%  Parameter not used. 
  950.       lParam&  The low-order 2 bytes specify the number of vertical 
  951.                lines to scroll. The high-order 2 bytes specify the 
  952.                number of horizontal columns to scroll. A positive 
  953.                value for lParam& causes text to scroll upward or to the 
  954.                left. A negative value causes text to scroll downward or 
  955.                to the right. 
  956.       r&       Indicates the number of lines actually scrolled. 
  957.  The SendMessage API function requires the window handle (hWd% above) 
  958.  of the text box. To get the window handle of the text box, you must 
  959.  first set the focus on the text box using the SetFocus method from 
  960.  Visual Basic. Once the focus has been set, call the GetFocus API 
  961.  function to get the window handle for the text box. Below is an 
  962.  example of how to get the window handle of a text box. 
  963.       'The following appears in the general declarations section of the 
  964.       'form: 
  965.       Declare Function GetFocus% Lib "USER" () 
  966.       'Assume the following appears in the click event procedure of a 
  967.       'command button called Scroll. 
  968.       Sub Command_Scroll_Click () 
  969.            OldhWnd% = GetFocus ()    'Store the window handle of the 
  970.                                      'control that currently has the 
  971.                                      'focus. 
  972.            Text1.SetFocus 
  973.            hWd% = GetFocus() 
  974.       End Sub 
  975.  To scroll text horizontally, the text box must have a horizontal 
  976.  scroll bar, and the width of the text must be wider than the text box 
  977.  width. Calling SendMessage to scroll text vertically does not require 
  978.  a vertical scroll bar, but the length of text within the text box 
  979.  should exceed the text box height. 
  980.  Below are the steps necessary to create a text box that will scroll 
  981.  five vertical lines or five horizontal columns each time you click the 
  982.  command buttons labeled "Vertical" and "Horizontal": 
  983.   1. From the File menu, choose New Project (ALT+F+N). 
  984.   2. Double-click on Form1 to bring up the code window. 
  985.   3. Add the following API declaration in the General Declarations 
  986.      section of Form1. Note that you must put all Declare statements on a 
  987.      separate and single line. Also note that SetFocus is aliased as 
  988.      PutFocus because there already exists a SetFocus method within Visual 
  989.      Basic. 
  990.      Declare Function GetFocus% Lib "user" () 
  991.      Declare Function PutFocus% Lib "user" Alias "SetFocus" (ByVal 
  992.                                                             hWd%) 
  993.      Declare Function SendMessage& Lib "user" (ByVal hWd%, 
  994.                                                ByVal wMsg%, 
  995.                                                ByVal wParam%, 
  996.                                                ByVal lParam&) 
  997.   4. Create a text box called Text1 on Form1. Set the MultiLine 
  998.      property to True and the ScrollBars property to Horizontal (1). 
  999.   5. Create a command button called Command1 and change the Caption 
  1000.      to "Vertical". 
  1001.   6. Create a another command button called Command2 and change the 
  1002.      Caption to "Horizontal". 
  1003.   7. From the General Declarations section of Form1, create a procedure 
  1004.      to initialize some text in the text box as follows: 
  1005.      Sub InitializeTextBox () 
  1006.         Text1.Text = "" 
  1007.         For i% = 1 To 50 
  1008.            Text1.Text = Text1.Text + "This is line " + Str$(i%) 
  1009.            'Add 15 words to a line of text 
  1010.            For j% = 1 to 10 
  1011.               Text1.Text = Text1.Text + " Word "+ Str$(j%) 
  1012.            Next j% 
  1013.            'Force a carriage return (CR) linefeed (LF) 
  1014.            Text1.Text = Text1.Text + Chr$(13) + Chr$(10) 
  1015.            x% = DoEvents() 
  1016.         Next i% 
  1017.      End Sub 
  1018.   8. Add the following code to the load event procedure of Form1: 
  1019.      Sub Form_Load () 
  1020.         Call InitializeTextBox 
  1021.      End Sub 
  1022.   9. Create the actual scroll procedure within the General Declarations 
  1023.      section of Form1 as follows: 
  1024.      'The following two lines must appear on a single line: 
  1025.      Function ScrollText& (TextBox As Control, vLines As Integer, hLines 
  1026.                            As Integer) 
  1027.         Const EM_LINESCROLL = &H406 
  1028.         'Place the number of horizontal columns to scroll in the high- 
  1029.         'order 2 bytes of Lines&. The vertical lines to scroll is 
  1030.         'placed in the low-order 2 bytes. 
  1031.         Lines& = Clng(&H10000 * hLines) + vLines 
  1032.         'get the window handle of the control that currently has the 
  1033.         'focus, Command1 or Command2. 
  1034.         SavedWnd% = GetFocus%() 
  1035.         'set focus to the passed control (Text control) 
  1036.         TextBox.SetFocus 
  1037.         'get the handle to current focus (Text control) 
  1038.         TextWnd% = GetFocus%() 
  1039.         'scroll the lines 
  1040.         Success& = SendMessage(TextWnd%, EM_LINESCROLL, 0, Lines&) 
  1041.         'restore the focus to the original control, Command1 or 
  1042.         'Command2 
  1043.         r% = PutFocus% (SavedWnd%) 
  1044.         'return the number of lines actually scrolled 
  1045.         ScrollText& = Success& 
  1046.      End Function 
  1047.  10. Add the following code to the click event procedure of Command1 
  1048.      labeled "Vertical": 
  1049.      Sub Command1_Click () 
  1050.         'Scroll text 5 vertical lines upward 
  1051.         Num& = ScrollText&(Text1, 5, 0) 
  1052.      End Sub 
  1053.  11.  Add the following code to the click event procedure of Command2 
  1054.       labeled "Horizontal": 
  1055.       Sub Command2_Click () 
  1056.           'Scroll text 5 horizontal columns to the left 
  1057.           Num& = ScrollText&(Text1, 0, 5) 
  1058.       End Sub 
  1059.  12. Run the program. Click the command buttons to scroll the text five 
  1060.      lines or columns at a time. 
  1061. Title: "[" May Incorrectly Sort in List/Combo Box if Sorted=True 
  1062. Document Number: Q73838           Publ Date: 16-JUL-1991 
  1063. Product Name: Microsoft Visual Basic 
  1064. Product Version:  1.00 
  1065. Operating System: WINDOWS 
  1066.  
  1067.  Summary: 
  1068.  An example below demonstrates a problem using the Sorted property to 
  1069.  sort a string beginning with a bracket ([) in either a list box or 
  1070.  combo box in Microsoft Visual Basic programming system version 1.0 for 
  1071.  Windows. 
  1072.  This sorting problem is actually caused by Microsoft Windows 3.0 
  1073.  (buglist3.00) and is not caused by Visual Basic. Microsoft is 
  1074.  researching this problem and will post new information here as it 
  1075.  becomes available. 
  1076.  More Information: 
  1077.  Steps to Reproduce Problem 
  1078.  -------------------------- 
  1079.  1. In the Visual Basic environment, from the File menu, choose New 
  1080.     Project. 
  1081.  2. Place two list boxes or two combo boxes on the form. 
  1082.  3. Select from the Properties Bar the Sorted property for either the 
  1083.     two list boxes or two combo boxes to True. 
  1084.     Note: Do not invoke List1.Sorted = -1 within the code of an event 
  1085.     procedure because this causes the following run-time error: 
  1086.        "Sorted" property cannot be set at runtime 
  1087.  4. Add some code to the Form_Click event procedure. Below are two 
  1088.     separate examples of the code to add, depending on if you are using 
  1089.     list boxes or combo boxes: 
  1090.        Sub Form_Click ()         Sub Form_Click () 
  1091.         List1.AddItem "["          Combo1.AddItem "[" 
  1092.         List1.AddItem "\"          Combo1.AddItem "\" 
  1093.         List1.AddItem "a"          Combo1.AddItem "a" 
  1094.         List2.AddItem "a"          Combo2.AddItem "a" 
  1095.         List2.AddItem "\"          Combo2.AddItem "\" 
  1096.         List2.AddItem "["          Combo2.AddItem "[" 
  1097.        End Sub                   End Sub 
  1098.  5. From the Run menu, choose Start, or press F5 to run the code. 
  1099.  6. Click on the form to see the sequence "a [ \" in the first 
  1100.     list box or combo box and see the different sequence "[ \ a" in the 
  1101.     second list box or combo box. 
  1102.  This reveals an inconsistency with an internal Windows 3.0 sorting 
  1103.  routine. If you replace the bracket character with the character "b", the 
  1104.  two boxes correctly sort in the same order (\ a b). The problem is 
  1105.  with sorting the bracket character. 
  1106. Title: Initial ForeColor/BackColor on Color Palette Can Be Reversed 
  1107. Document Number: Q74265           Publ Date: 16-JUL-1991 
  1108. Product Name: Microsoft Visual Basic 
  1109. Product Version:  1.00 
  1110. Operating System: WINDOWS 
  1111.  
  1112.  Summary: 
  1113.  This article explains a problem with the Color Palette in Microsoft 
  1114.  Visual Basic programming system version 1.0. The following steps 
  1115.  reproduce the problem: 
  1116.  1. Start Visual Basic; the default Form1 will display. 
  1117.  2. From the File menu, choose Save Project As, and follow the prompts 
  1118.     to save under the default name Form1.frm, followed by Project1.mak. 
  1119.  3. From the Window menu, choose Color Palette. Notice the default 
  1120.     colors presented for the background and foreground in the 
  1121.     left box. The foreground is black and the background is white. 
  1122.  4. Exit Visual Basic. 
  1123.  5. From the Program Manager's File menu, choose the Run command and 
  1124.     enter the following path: 
  1125.        C:\VB\Project1.mak 
  1126.  6. This should begin running Visual Basic with the previously saved 
  1127.     example Project1.mak that you saved in step 2. 
  1128.  7. Notice the Color Palette is displayed differently. The background 
  1129.     is now black instead of white and the foreground is now white 
  1130.     instead of black. 
  1131.  This problem occurs only when a project is run from the command line. 
  1132.  The above problem can be corrected by adding one more step: View the 
  1133.  Form by selecting Form1.frm from the Project1 Window. This causes the 
  1134.  Color Palette to be displayed correctly with the background being 
  1135.  white instead of black. 
  1136.  Microsoft has confirmed this to be a problem with Microsoft Visual 
  1137.  Basic programming system version 1.0. We are researching this problem 
  1138.  and will post new information here as it becomes available. 
  1139. Title: "[" May Incorrectly Sort in VB List/Combo Box If Sorted=True 
  1140. Document Number: Q74132           Publ Date: 16-JUL-1991 
  1141. Product Name: Microsoft Visual Basic 
  1142. Product Version:  1.00 
  1143. Operating System: WINDOWS 
  1144.  
  1145.  Summary: 
  1146.  An example below demonstrates a problem using the Sorted property to 
  1147.  sort a string beginning with a bracket "[" in either a list box or 
  1148.  combo box in Microsoft Visual Basic programming system version 1.0 for 
  1149.  Windows. 
  1150.  This sorting problem is actually caused by Microsoft Windows 3.0 
  1151.  (buglist3.00) and is not caused by Visual Basic. Microsoft is 
  1152.  researching this problem and will post new information here as it 
  1153.  becomes available. 
  1154.  More Information: 
  1155.  The following steps duplicate the problem: 
  1156.  1. In the Visual Basic environment, choose New Project from the File 
  1157.     menu. 
  1158.  2. Place two list boxes or two combo boxes on the form. 
  1159.  3. From the Properties Bar, set the Sorted property for either the two 
  1160.     list boxes or two combo boxes to True. 
  1161.     Note: Do not invoke List1.Sorted = -1 within the code of an event 
  1162.     procedure because this causes the run-time error "'Sorted' 
  1163.     property cannot be set at run time." 
  1164.  4. Now add some code to the Form_Click event procedure. Below are two 
  1165.     separate examples of the code to add depending on if you are using 
  1166.     list boxes or combo boxes: 
  1167.     Sub Form_Click ()         Sub Form_Click () 
  1168.      List1.AddItem "["          Combo1.AddItem "[" 
  1169.      List1.AddItem "\"          Combo1.AddItem "\" 
  1170.      List1.AddItem "a"          Combo1.AddItem "a" 
  1171.      List2.AddItem "a"          Combo2.AddItem "a" 
  1172.      List2.AddItem "\"          Combo2.AddItem "\" 
  1173.      List2.AddItem "["          Combo2.AddItem "[" 
  1174.     End Sub                   End Sub 
  1175.  5. Run the code by pressing the F5 function key or choosing Start from 
  1176.     the Run menu. 
  1177.  6. Click on the form to see the sequence "a [ \" in the first list box 
  1178.     or combo box and to see the different sequence "[ \ a" in the 
  1179.     second list box or combo box. 
  1180.  This reveals an inconsistency with an internal Windows 3.0 sorting 
  1181.  routine. If you replace the character "[" with the character "b", the 
  1182.  two boxes correctly sort in the same order: "\ a b". The problem is 
  1183.  with sorting the "[" character. 
  1184. Title: Extra Click Required to Return Focus to Code and Select Text 
  1185. Document Number: Q74294           Publ Date: 16-JUL-1991 
  1186. Product Name: Microsoft Visual Basic 
  1187. Product Version:  1.00 
  1188. Operating System: WINDOWS 
  1189.  
  1190.  Summary 
  1191.  You must use an extra click when returning focus from the Menu bar, 
  1192.  Toolbox, or the Properties bar to the current code window and then 
  1193.  attempting to either select text or set the insertion point. Contrary 
  1194.  to the standard Windows convention, which requires only one mouse 
  1195.  click and hold to accomplish this, Visual Basic 1.0 requires you to 
  1196.  click once to set the focus to the code window, and then again to 
  1197.  position the insertion point or select text. 
  1198.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  1199.  programming system version 1.0 for Windows. We are researching this 
  1200.  problem and will post new information here as it becomes available. 
  1201.  More Information: 
  1202.  To duplicate this problem, start with a new project in the Visual 
  1203.  Basic environment: 
  1204.  1. Double-click on Form1 to to open the Form1_Click procedure code 
  1205.     window. 
  1206.  2. Click on Visual Basic's Main menu, Properties bar, or Toolbox. 
  1207.  3. Try to position the insertion point or select text in the 
  1208.     Form1_Click code window. The first click merely shifts the focus 
  1209.     to the code window, but the insertion point is not positioned in 
  1210.     the window, nor is any text selected. 
  1211.  You must release the mouse button and click again to select text or 
  1212.  place the insertion point. The problem also occurs in the Copy/Paste 
  1213.  or Cut/Paste process. When you attempt to Paste, you must click a 
  1214.  second time to place the insertion point where desired for the Paste. 
  1215. Title: If Directory Deleted, Directories Empty in Save Project As Box 
  1216. Document Number: Q74192           Publ Date: 16-JUL-1991 
  1217. Product Name: Microsoft Visual Basic 
  1218. Product Version:  1.00 
  1219. Operating System: WINDOWS 
  1220.  
  1221.  Summary: 
  1222.  The following is a small user-interface problem with the Save Project 
  1223.  As dialog box in Microsoft Visual Basic programming system version 1.0 
  1224.  for Windows. 
  1225.  If you currently have a project loaded in Visual Basic and, from a 
  1226.  simultaneous DOS session in Windows, you delete that project and its 
  1227.  subdirectory, then the next Save Project As command will incorrectly 
  1228.  display an empty Directories list box. Subsequent Save Project As 
  1229.  commands correctly show the Directories list box. 
  1230.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  1231.  programming system version 1.0 for Windows.  We are researching this 
  1232.  problem and will post new information here as it becomes available. 
  1233.  More Information: 
  1234.  The following steps reproduce the problem. 
  1235.  1. Go to a DOS prompt and change directory to the Visual Basic 
  1236.     directory (CHDIR \VB). From this directory, make a new directory 
  1237.     with the MKDIR command; for example, MKDIR TEST. 
  1238.  2. Now go back into Windows. From Visual Basic's File menu, choose 
  1239.     Save Project As. Choose Yes to save the form as Form1.Frm. Next, 
  1240.     save the form under the following path: 
  1241.        C:\VB\TEST\Form1.Frm 
  1242.  3. After you press ENTER or choose OK, another message will display, 
  1243.     asking you to save the Project1.Mak. Choose OK, and enter the path: 
  1244.        C:\VB\TEST\Project1.Mak 
  1245.  4. Minimize Visual Basic and activate a DOS prompt box from Windows. 
  1246.     From the directory C:\VB\TEST you should see the Project1.Mak and 
  1247.     Form1.Frm files. Delete these files with DEL *.* and answer Y. 
  1248.     Change directories to the C:\VB directory (CHDIR ...). Remove the 
  1249.     TEST directory with the command RMDIR TEST. Now EXIT from DOS and 
  1250.     return to your Visual Basic session within Windows. 
  1251.  5. Now try to save the project by choosing Save Project As. A message 
  1252.     will correctly state "Path not found: 'C:\VB\TEST'". Choose OK; 
  1253.     then you will see a Save Project As window displayed with an empty 
  1254.     "File Name", but the "Directories" list box will incorrectly be 
  1255.     blank. The problem is minor, since subsequent Save Project As 
  1256.     commands correctly display directories in the "Directories" list 
  1257.     box. 
  1258. Title: "UAE" Changing Display of DOS Window When VB Is at Breakpoint 
  1259. Document Number: Q74193           Publ Date: 16-JUL-1991 
  1260. Product Name: Microsoft Visual Basic 
  1261. Product Version:  1.00 
  1262. Operating System: WINDOWS 
  1263.  
  1264.  Summary: 
  1265.  This information applies to Microsoft Visual Basic programming system 
  1266.  version 1.0 for Microsoft Windows. 
  1267.  When using some Windows display drivers, the following steps may cause 
  1268.  Microsoft Visual Basic to abort with an "UNRECOVERABLE APPLICATION 
  1269.  ERROR:" 
  1270.  1. Start Microsoft Visual Basic. 
  1271.  2. Add a line of code to the Form_Click event procedure, such as 
  1272.     "X = 5". 
  1273.  3. Set a break point on the line added in step 2. 
  1274.  4. Start a simultaneous DOS session in Windows. 
  1275.  5. Run the Visual Basic program (F5); click on the form to stop at 
  1276.     the break point. 
  1277.  6. Activate (double-click) the DOS window. 
  1278.  7. Press ALT+ENTER to change the DOS window to a full screen window. 
  1279.  After pressing ALT+ENTER to change the DOS window to a full screen DOS 
  1280.  session, Microsoft Visual Basic may quit with an "UNRECOVERABLE 
  1281.  APPLICATION ERROR."  This behavior is a result of problems with 
  1282.  certain Windows display drivers, and not a problem with Visual Basic. 
  1283. Title: Can Click in Code Window Without Activating it, in VB.EXE 
  1284. Document Number: Q74194           Publ Date: 16-JUL-1991 
  1285. Product Name: Microsoft Visual Basic 
  1286. Product Version:  1.00 
  1287. Operating System: WINDOWS 
  1288.  
  1289.  Summary: 
  1290.  If you have both a form and code window present at design time in 
  1291.  Microsoft Visual Basic with the current focus on the form, clicking on 
  1292.  the upper or lower edge of the splitter bar in the code window will 
  1293.  fail to shift the focus to the code window. Clicking anywhere else on 
  1294.  the code window correctly shifts the focus and activates the code 
  1295.  window. 
  1296.  This information applies to Microsoft Visual Basic programming system 
  1297.  version 1.0 for Windows. 
  1298.  More Information: 
  1299.  To reproduce this problem in Visual Basic, choose the New Project 
  1300.  option from Visual Basic's File menu. Double-click on Form1 to open a 
  1301.  code window, then click on Form1 to return focus to the form. Now 
  1302.  place the tip of the mouse pointer on the upper or lower edge of the 
  1303.  code window's splitter bar such that the pointer remains an arrow, and 
  1304.  is not an I-beam pointer or splitter pointer. Clicking now fails to 
  1305.  shift the focus to the code window. You can click anywhere else in the 
  1306.  code window and the code window will correctly become the active 
  1307.  window. 
  1308.  Note that the "splitter bar" (the horizontal border just above the 
  1309.  editing area and just above the vertical scroll bar) allows you to 
  1310.  split the code window into two parts, which allows you to view two 
  1311.  different sections of code at once. 
  1312. Title: Why Output Might Not Display from VB Form_Load Procedure 
  1313. Document Number: Q71101           Publ Date: 22-JUL-1991 
  1314. Product Name: Microsoft Visual Basic 
  1315. Product Version:  1.00 
  1316. Operating System: WINDOWS 
  1317.  
  1318.  Summary: 
  1319.  Any graphics or output done within a Form_Load procedure will not 
  1320.  display on the form unless you first make the form visible with the 
  1321.  Form1.Show method or if you set the form's AutoRedraw property to be 
  1322.  true (non-zero). 
  1323.  This information applies to Microsoft Visual Basic Programming System 
  1324.  version 1.0 for Windows. 
  1325.  More Information: 
  1326.  When the Form_Load procedure executes (at the beginning of the 
  1327.  program), by default the form is not yet displayed. Therefore, during 
  1328.  the Form_Load event, no graphics are displayed to the nonexistent form 
  1329.  unless you first Show the form (at run time) or set the form's 
  1330.  AutoRedraw property (at design time or run time). 
  1331.  A better approach to drawing graphics to the form is to have the 
  1332.  graphics drawn to the form during a Sub Form_Paint procedure. This 
  1333.  allows the Form.AutoRedraw property to be set to FALSE, increasing the 
  1334.  speed performance of your program. Visual Basic does not have to 
  1335.  refresh the screen image of your form as it does when a form is 
  1336.  overlapped with another window. You (as the programmer) are 
  1337.  responsible for refreshing the form, and Sub Form_Paint is the most 
  1338.  logical place to handle this situation. 
  1339.  Listed below are three examples of drawing graphics to your form. The 
  1340.  first example shows how the graphics fail to be displayed to the form 
  1341.  when drawn from within a Form_Load event procedure. The second example 
  1342.  shows how you could draw a circle to the form, but the Form.AutoRedraw 
  1343.  property must be set to TRUE for the circle to be retained in the 
  1344.  event the form needs to be refreshed. The third example is the best 
  1345.  approach; it is the fastest and most efficient of the three. 
  1346.  For each example below, add the following Function procedure as a code 
  1347.  procedure to Form1. 
  1348.  Function Minimum! (n1!, n2!) 
  1349.      If n1! < n2! Then 
  1350.          Minimum! = n1! 
  1351.      Else 
  1352.          Minimum! = n2! 
  1353.      End If 
  1354.  End Function 
  1355.  Example 1 
  1356.  --------- 
  1357.  No graphic is displayed to the form in the following: 
  1358.  Sub Form_Load 
  1359.     Row = Form1.ScaleHeight / 2 
  1360.     Col = Form1.ScaleWidth / 2 
  1361.     Radius = Minimum(Row, Col)   ' Function that returns smaller number. 
  1362.     Form1.Circle (Col, Row), Radius 
  1363.  End Sub 
  1364.  Example 2 
  1365.  --------- 
  1366.  This example will work, but the AutoRedraw property of Form1 must be 
  1367.  TRUE for the screen to refresh properly: 
  1368.  Sub Form_Load 
  1369.     Form1.Show 
  1370.     Form1.AutoRedraw = -1 
  1371.     Row = Form1.ScaleHeight / 2 
  1372.     Col = Form1.ScaleWidth / 2 
  1373.     Radius = Minimum(Row, Col)   ' Function that returns smaller number. 
  1374.     Form1.Circle (Col, Row), Radius 
  1375.  End Sub 
  1376.  Example 3 
  1377.  --------- 
  1378.  This is the best example. AutoRedraw should be set to FALSE for 
  1379.  better speed and efficiency. 
  1380.  Sub Form_Paint 
  1381.     Row = Form1.ScaleHeight / 2 
  1382.     Col = Form1.ScaleWidth / 2 
  1383.     Radius = Minimum(Row, Col)   ' Function that returns smaller number. 
  1384.     Form1.Circle (Col, Row), Radius 
  1385.  End Sub 
  1386. Title: After Access (ALT+) Key, First Input to Combo Box Is Ignored 
  1387. Document Number: Q73040           Publ Date: 17-JUL-1991 
  1388. Product Name: Microsoft Visual Basic 
  1389. Product Version:  1.00 
  1390. Operating System: MS-DOS 
  1391.  
  1392.  Summary: 
  1393.  In Microsoft Visual Basic version 1.0, if a combo box has the focus 
  1394.  and you use an access key (ALT + another key) to set the focus to 
  1395.  another object, and you then give the focus back to the combo box 
  1396.  (either by tabbing or using the mouse), then the next text key you 
  1397.  enter into the combo box will be ignored. 
  1398.  Microsoft has confirmed this problem in Microsoft Visual Basic version 
  1399.  1.0 programming system for Windows. We are researching this problem 
  1400.  and will post new information here as it becomes available. 
  1401.  More Information: 
  1402.  Steps to Reproduce Problem 
  1403.  -------------------------- 
  1404.  1. Start Visual Basic. 
  1405.  2. On a form, create a combo box and a command button. 
  1406.  3. Change the caption property of the command button to "&Command1". 
  1407.     This makes ALT+C the access key for Command1. 
  1408.  4. Run the application. 
  1409.  Note that when you type ALT+C and then reset the focus back to the combo 
  1410.  box, either with the mouse or by using the TAB key, the next key you 
  1411.  press to enter text in the combo box will be ignored. 
  1412.  This problem occurs for both drop-down and simple combo boxes, styles 
  1413.  0 and 1. 
  1414. Title: Procedure Name Remaining in Procedure Combo Box After Deletion 
  1415. Document Number: Q73653           Publ Date: 18-JUL-1991 
  1416. Product Name: Microsoft Visual Basic 
  1417. Product Version:  1.00 
  1418. Operating System: WINDOWS 
  1419.  
  1420.  Summary: 
  1421.  If you delete the SUB and END SUB (or FUNCTION and END FUNCTION) lines 
  1422.  in a user-defined procedure and leave one or more blank lines in 
  1423.  that procedure's code window, the procedure name remains in the combo 
  1424.  box containing the procedure names (hereafter referred to as the 
  1425.  procedure combo box). 
  1426.  Also, if you delete the SUB and END SUB lines for a standard Visual 
  1427.  Basic event procedure and you leave one or more blank lines, the code 
  1428.  will remain blank for that procedure instead of returning to the 
  1429.  standard SUB and END SUB syntax for that event. 
  1430.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  1431.  programming system version 1.0 for Windows. We are researching this 
  1432.  problem and will post new information here as it becomes available. 
  1433.  More Information: 
  1434.  Steps to Reproduce Problem 
  1435.  -------------------------- 
  1436.  1. From the File menu, select New Project (ALT, F, N). 
  1437.  2. Double-click on the default form (Form1). 
  1438.  3. From the General Declarations section of Form1, do the 
  1439.     following: 
  1440.     a. Type "Sub MySub" (without the quotation marks) and press ENTER. 
  1441.     b. Insert a least one blank line between the SUB ... END SUB 
  1442.        statements. 
  1443.     c. Delete just the statements Sub MySub () and End Sub, and leave 
  1444.        at least one blank line between them. 
  1445.  The procedure name MySub will still appear in the procedure combo box; 
  1446.  however, when you switch to the code window for the procedure, it will 
  1447.  appear to be empty. The blank line that was added in step 3.b. above 
  1448.  will still be present. 
  1449.  To remove the procedure name MySub from the procedure combo box, 
  1450.  delete all of the blank space within the code window. 
  1451. Title: Comments and Blank Lines Increase Size of VB 1.0 .EXE File 
  1452. Document Number: Q73697           Publ Date: 17-JUL-1991 
  1453. Product Name: Microsoft Visual Basic 
  1454. Product Version:  1.00 
  1455. Operating System: WINDOWS 
  1456.  
  1457.  Summary: 
  1458.  Each line containing blank space or a comment in any code window of a 
  1459.  Visual Basic application adds 2 bytes to the size of the compiled 
  1460.  executable file (.EXE). This is not a problem with Visual Basic, but 
  1461.  rather it is part of Visual Basic's design. 
  1462.  This information applies to the Visual Basic programming system 
  1463.  version 1.0 for Windows. 
  1464.  More Information: 
  1465.  The 2 byte overhead for each line containing blank space or a comment 
  1466.  is generated as part of the pseudo-code for the application in the 
  1467.  VB.EXE development environment. The program is run in "interpreted 
  1468.  mode" based on this pseudo-code. Because an .EXE program is generated 
  1469.  based on this pseudo-code (in other words, Visual Basic does not use a 
  1470.  compiler and linker), the 2 byte overhead is copied to the .EXE 
  1471.  program. The only workaround for this behavior is to remove comments 
  1472.  and blank lines before compiling the Visual Basic project. 
  1473. Title: Cannot Tile or Cascade Programs Created with Visual Basic 
  1474. Document Number: Q73698           Publ Date: 17-JUL-1991 
  1475. Product Name: Microsoft Visual Basic 
  1476. Product Version:  1.00 
  1477. Operating System: WINDOWS 
  1478.  
  1479.  Summary: 
  1480.  Applications that have been created with Microsoft Visual Basic 1.0 do 
  1481.  not tile or cascade as do other Windows applications. 
  1482.  This information applies to Microsoft Visual Basic programming system 
  1483.  version 1.0 for Windows. 
  1484.  More Information: 
  1485.  Visual Basic creates applications that are pop-up windows. This window 
  1486.  style does not respond to the tile or cascade message sent from the 
  1487.  Windows 3.0 Task List or other applications that support the cascade 
  1488.  and tile features. 
  1489.  You can verify this action by launching two applications created in 
  1490.  Visual Basic, then bringing up the Windows Task List by pressing 
  1491.  CTRL+ESC, and from the Task List choosing either the Cascade or Tile 
  1492.  button. Notice that nothing has changed in the arrangements of these 
  1493.  two Visual Basic application windows. You may have expected the Visual 
  1494.  Basic application windows to cascade or tile as other Windows 
  1495.  applications do, but they will not do so. 
  1496. Title: Some VB.EXE Main Menu Commands Can Be Invisible at Run Time 
  1497. Document Number: Q73699           Publ Date: 17-JUL-1991 
  1498. Product Name: Microsoft Visual Basic 
  1499. Product Version:  1.00 
  1500. Operating System: WINDOWS 
  1501.  
  1502.  Summary: 
  1503.  If you shrink the width of VB.EXE's main menu (and Properties Bar) such 
  1504.  that menu commands automatically wrap to the next line, wrapped 
  1505.  menu commands may be invisible at run time in the VB.EXE environment. 
  1506.  You can work around this visibility problem by using the ALT key to 
  1507.  access the invisible menu commands on the shrunken menu, or by 
  1508.  avoiding shrinking the width beyond the point where the menus wrap. 
  1509.  This information applies to Microsoft Visual Basic programming system 
  1510.  version 1.0 for Windows. 
  1511.  More Information: 
  1512.  Steps to Reproduce Problem 
  1513.  -------------------------- 
  1514.  1. Start Visual Basic (VB.EXE). 
  1515.  2. Place the mouse pointer on the far right side of the Properties 
  1516.     Bar such that the mouse changes to a double-headed pointer, ready 
  1517.     for resizing the Properties Bar. 
  1518.  3. Press and hold down the left button of the mouse and drag the right 
  1519.     edge of the Properties Bar toward the left side of the screen so that 
  1520.     the Bar ends up being about 3 inches in width, then release the mouse 
  1521.     button. This should cause the Window and Help menu commands to 
  1522.     automatically wrap the next line. 
  1523.  4. From the Run menu, choose Start, or press F5. The Window and Help 
  1524.     menus are now invisible because they are wrapped beyond the edge of 
  1525.     their window. 
  1526.  5. Click on the Immediate Window (in the lower right corner) and bring 
  1527.     the Immediate Window in front of the Form1 window. 
  1528.  6. Try bringing up the either the Window menu by pressing ALT+W or the 
  1529.     Help menu by pressing ALT+H. You will see the appropriate menu on the 
  1530.     screen, but it will appear disconnected below the Main Menu (or 
  1531.     Properties Bar) even though the menu is still functional. If you don't 
  1532.     perform step 5, you won't be able to select the invisible menus with 
  1533.     the ALT key (or with the mouse). 
  1534.  This behavior is due to the way that Windows 3.0 manipulates menus and 
  1535.  the design of the Microsoft Visual Basic 1.0 interface. To avoid this 
  1536.  behavior, Microsoft recommends keeping the main menu sufficiently wide 
  1537.  such that menus are not wrapped. 
  1538. Title: TABs Paste Incorrectly as ] to VB.EXE's Immediate Window 
  1539. Document Number: Q73700           Publ Date: 17-JUL-1991 
  1540. Product Name: Microsoft Visual Basic 
  1541. Product Version:  1.00 
  1542. Operating System: WINDOWS 
  1543.  
  1544.  Summary: 
  1545.  TAB characters may Paste (from the Windows Clipboard) incorrectly into 
  1546.  the Immediate Window in Microsoft Visual Basic version 1.0. (TAB 
  1547.  characters may incorrectly Paste as pipe []| symbols.) 
  1548.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  1549.  programming system version 1.00 for Windows. We are researching this 
  1550.  problem and will post new information here as it becomes available. 
  1551.  More Information: 
  1552.  Steps to Reproduce Problem 
  1553.  -------------------------- 
  1554.  1. From Windows 3.0, run NOTEPAD.EXE and enter the following text: 
  1555.        a <TAB> a 
  1556.     This will be displayed in the following format: 
  1557.        a     a 
  1558.  2. Select the text with the mouse and choose Copy from Notepad's 
  1559.     Edit menu to copy the text to the Windows Clipboard. 
  1560.  3. Start Visual Basic and press F5 to run the blank program (or from 
  1561.     the Run menu, choose Start). 
  1562.  4. Break the program by pressing CTRL+BREAK, then click the mouse on 
  1563.     the Immediate Window. 
  1564.  5. Press SHIFT+INSERT to enter the selected text into the Immediate 
  1565.     Window. Observe that the Immediate Window incorrectly displays the 
  1566.     following text: 
  1567.        a]a 
  1568.     instead of displaying the following: 
  1569.        a     a 
  1570.  6. If you end the program (by choosing the End command from the Run 
  1571.     menu), you will be able to successfully paste (SHIFT+INSERT) the 
  1572.     correct text into any code window: 
  1573.        a     a 
  1574. Title: How to Optimize Size and Speed of Visual Basic Applications 
  1575. Document Number: Q73798           Publ Date: 17-JUL-1991 
  1576. Product Name: Microsoft Visual Basic 
  1577. Product Version:  1.00 
  1578. Operating System: WINDOWS 
  1579.  
  1580.  Summary: 
  1581.  This article describes how to optimize size and speed for applications 
  1582.  in Microsoft Visual Basic programming system version 1.0 for Windows. 
  1583.  More Information: 
  1584.  Below are guidelines to help increase speed, available resources, 
  1585.  available RAM, and available disk space in Visual Basic: 
  1586.  Increase Speed 
  1587.  -------------- 
  1588.     - Preload forms. 
  1589.     - Store graphics as bitmaps. 
  1590.     - Place debug routines in a separate module. 
  1591.     - Use dynamic link library (DLL) routines. 
  1592.  Increase Available Resources 
  1593.  ---------------------------- 
  1594.   - Create simulated controls using a graphic object. 
  1595.   - Draw graphics images during run time. 
  1596.  Increase Available RAM 
  1597.  ---------------------- 
  1598.   - Use Integer variables instead of Single variables. 
  1599.   - Create dynamic arrays to free arrays when not needed. 
  1600.   - Drop/unload controls and forms when not needed. 
  1601.   - Use local variables. 
  1602.  Increase Disk Space 
  1603.  ------------------- 
  1604.     - Build controls at load time. 
  1605.     - Minimize header size. 
  1606.     - Delete unnecessary functions and subroutines. 
  1607.     - Delete unused objects and associated methods. 
  1608. Title: No Edit Menu Access for Property Entry; Use Edit Shortcut Keys 
  1609. Document Number: Q73800           Publ Date: 17-JUL-1991 
  1610. Product Name: Microsoft Visual Basic 
  1611. Product Version:  1.00 
  1612. Operating System: WINDOWS 
  1613.  
  1614.  Summary: 
  1615.  The following information applies to Microsoft Visual Basic 
  1616.  programming system version 1.0 for Windows. 
  1617.  The Properties Bar entry window was not designed to handle the Edit 
  1618.  menu commands (such as Cut, Copy, Paste, and Undo) when chosen with 
  1619.  the mouse. The Edit menu commands affect the controls on the form, 
  1620.  not the Properties Bar entry window (even if you first select text in 
  1621.  the Properties Bar entry window before choosing the Edit menu with the 
  1622.  mouse). 
  1623.  Instead of choosing Edit commands with the mouse, you can select the 
  1624.  desired text in the Properties Bar entry window and use the Edit 
  1625.  shortcut keys, as follows: 
  1626.  Command    Shortcut Keys 
  1627.  -------    ------------- 
  1628.  Cut        SHIFT+DELETE 
  1629.  Copy       CTRL+INSERT 
  1630.  Paste      SHIFT+INSERT 
  1631.  Undo       ALT+BACKSPACE 
  1632.  (NUM LOCK needs to be off if you select the DELETE or INSERT key 
  1633.  from the numeric keypad.) 
  1634.  More Information: 
  1635.  Example: Edit Menu Cannot Affect Properties Bar Entry Window 
  1636.  ------------------------------------------------------------ 
  1637.  1. Start Visual Basic. 
  1638.  2. From the File menu, choose New Project. 
  1639.  3. Double-click on a label box from the Toolbox (symbolized by a 
  1640.     capital A in script). This should display a label box on the 
  1641.     form. 
  1642.  4. With the mouse, select the text fragment "Lab" from the "Label1" 
  1643.     Caption in the Properties Bar entry window, and choose Copy from 
  1644.     the Edit menu. 
  1645.     Note: While you may have thought you just copied "Lab" into the 
  1646.     Clipboard, you actually copied the entire Label1 control (from 
  1647.     the form) into the Clipboard. Clicking the Edit menu anywhere 
  1648.     outside the Properties Bar entry window causes the focus to 
  1649.     revert back to the Label1 control on the form. 
  1650.  5. Click on the "Form1" text appearing in the Properties Bar entry 
  1651.     window to set the focus there. 
  1652.  6. From the Edit menu, choose Paste (again, clicking the Edit menu or 
  1653.     anywhere outside the Properties Bar entry window causes the focus to 
  1654.     revert back to the Label1 control on the form.) This causes the 
  1655.     following message box: 
  1656.        "You already have a control named 'Label1'. Do you want to 
  1657.         create a control array?". 
  1658.     Select either the Yes or No command button. Notice that 
  1659.     another copy of the Label1 box will appear in the upper left 
  1660.     corner of the form. 
  1661.  Instead of choosing Edit commands with the mouse, you can select the 
  1662.  desired text in the Properties Bar entry window and use the Edit 
  1663.  shortcut keys. For example, you can select text in the Properties Bar 
  1664.  entry window, then press CTRL+INSERT (while NUM LOCK is off) to copy 
  1665.  text to the Clipboard. You can press SHIFT+INSERT to paste Clipboard 
  1666.  text into the Properties Bar entry window. You can press ALT+BACKSPACE 
  1667.  to Undo a Cut, Copy, or Paste. 
  1668. Title: Visual Basic Applications Cannot Act as Windows Shell 
  1669. Document Number: Q73801           Publ Date: 17-JUL-1991 
  1670. Product Name: Microsoft Visual Basic 
  1671. Product Version:  1.00 
  1672. Operating System: WINDOWS 
  1673.  
  1674.  Summary: 
  1675.  An application created by Visual Basic cannot be used as the Windows 
  1676.  shell.  Attempting to run an application as the Windows shell results 
  1677.  in a Windows "Unrecoverable Application Error" (UAE) message. This is 
  1678.  expected behavior when attempting to run a Visual Basic application as 
  1679.  the Windows shell. This is not a problem with Visual Basic, but rather 
  1680.  a design limitation. This information only applies to Visual Basic 
  1681.  .EXE programs. 
  1682.  This information applies to Microsoft Visual Basic programming system 
  1683.  version 1.0 for Windows. 
  1684.  More Information: 
  1685.  A user-defined shell application can be specified in the Windows 
  1686.  system initialization (SYSTEM.INI) file. The default shell is 
  1687.  PROGMAN.EXE, or the Program Manager. If a Visual Basic program is 
  1688.  specified as the customized Windows shell, a Windows UAE will occur on 
  1689.  an attempt to run Windows from the DOS command line. 
  1690.  A Visual Basic application cannot be run as the Windows shell because 
  1691.  it does not contain the special set of startup code required by a 
  1692.  Windows shell application. The only way to create a Windows shell 
  1693.  application is to use the C Compiler and the Windows Software 
  1694.  Development Kit (SDK) to write a non-Visual Basic application. 
  1695.  Steps to Reproduce Problem 
  1696.  -------------------------- 
  1697.  Warning: The following steps require changing the Windows system 
  1698.  initialization file (SYSTEM.INI) in a manner such that Windows will 
  1699.  not run successfully unless the file is restored from DOS. The file 
  1700.  can be restored from DOS by using a backup copy of the SYSTEM.INI file 
  1701.  or by restoring the SYSTEM.INI file with a text editor from DOS. 
  1702.   1. Start Visual Basic. 
  1703.   2. From the File menu, choose New Project. 
  1704.   3. From the File menu, choose Make .EXE program. 
  1705.   4. Choose OK to select Project1.EXE as the .EXE filename. 
  1706.   5. Exit Visual Basic. 
  1707.   6. Start Windows Notepad. 
  1708.   7. From the File menu, choose Open. 
  1709.   8. In the Filename text box, type "c:\windows\system.ini" (without 
  1710.      the quotation marks) or the path and filename of the SYSTEM.INI 
  1711.      file on your system. 
  1712.   9. Choose OK. 
  1713.  10. Change the line the reads "shell=progman.exe" to 
  1714.     "shell=c:\vb\project1.exe", or the appropriate path to the file 
  1715.     created in step 4 above. 
  1716.  11. From the File menu, choose Save. 
  1717.  12. Exit Notepad. 
  1718.  13. From the Windows Program Manager File menu, choose Exit (you 
  1719.     should exit back to DOS). 
  1720.  14. At the DOS prompt, run Windows. 
  1721.  When you attempt to run Windows, a UAE will occur. You will need to 
  1722.  reboot your computer and modify the SYSTEM.INI with a text editor from 
  1723.  DOS such that the line "shell=c:\vb\project1.exe" appearing in the 
  1724.  SYSTEM.INI is changed back to "shell=progman.exe". 
  1725. Title: Deleting VB Control Moves Associated Code to Object: (General) 
  1726. Document Number: Q73808           Publ Date: 17-JUL-1991 
  1727. Product Name: Microsoft Visual Basic 
  1728. Product Version:  1.00 
  1729. Operating System: WINDOWS 
  1730.  
  1731.  Summary: 
  1732.  When you delete a control in the Visual Basic environment, the code 
  1733.  that you wrote for that control is not deleted, but is instead moved 
  1734.  to the Object: (General) area for code. Some programmers may not 
  1735.  realize that these detached (unused) procedures still exist and 
  1736.  consume memory. The detached code is available for calling, copying, 
  1737.  or reuse. For example, when you add a control that shares the same 
  1738.  name as a detached procedure, the detached event procedure 
  1739.  reassociates with that control. 
  1740.  If you want to delete both the control and its associated code, you 
  1741.  need to manually select and delete the code in each event procedure 
  1742.  for that control in addition to deleting the control itself. 
  1743.  This behavior is by design in Microsoft Visual Basic programming 
  1744.  system version 1.0 for Windows. 
  1745.  More Information: 
  1746.  The following example demonstrates that your code goes into the 
  1747.  Object: (General) area after you delete the associated control (or 
  1748.  object): 
  1749.  1. From the File menu, choose New Project. 
  1750.  2. Double-click on a command button from the Toolbox. This puts a 
  1751.     Command1 button on your form. 
  1752.  3. Double-click on the Command1 button. This brings up the code window 
  1753.     for the Command1_Click event procedure. 
  1754.  4. Enter the following code inside the Command1_Click procedure: 
  1755.        Sub Command1_Click() 
  1756.         Print "Hello"          'Enter this statement 
  1757.        End Sub 
  1758.  5. Press F5 to run your code. Click on the Command1 button to see the 
  1759.     text "Hello" display on Form1 in the upper left corner. From 
  1760.     the Run menu, choose End to stop the program. 
  1761.  6. Click on the Command1 button on Form1 to set the focus there and 
  1762.     either press DELETE or choose the Delete command from the Edit menu. 
  1763.     This deletes the Command1 button from the form. 
  1764.     At this point, some programmers may incorrectly assume that the 
  1765.     code associated with the Command1 button was also deleted. 
  1766.     Actually, the code associated with any deleted object is 
  1767.     automatically moved into the Object: (general) area of the Code 
  1768.     window for that form. You can find the detached procedures in the 
  1769.     Code window by choosing (general) from the Object: box, and 
  1770.     choosing the procedures from the Proc: box. (Click on the DOWN 
  1771.     arrow symbol on the right of the Object: and Proc: boxes to see 
  1772.     your choices.) 
  1773. Title: Pull-Down on Drive Box Disabled if Width Changed at Run Time 
  1774. Document Number: Q73809           Publ Date: 17-JUL-1991 
  1775. Product Name: Microsoft Visual Basic 
  1776. Product Version:  1.00 
  1777. Operating System: WINDOWS 
  1778.  
  1779.  Summary: 
  1780.  If you change the Width property of a drive list box at run time, the 
  1781.  pull-down list of drives will no longer work. 
  1782.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  1783.  programming system version 1.0 for Windows. Microsoft is researching 
  1784.  this problem and will post new information here as it becomes 
  1785.  available. 
  1786.  More Information: 
  1787.  Steps to Reproduce Problem 
  1788.  -------------------------- 
  1789.  1. Start Visual Basic. Form1 will automatically display. 
  1790.  2. Put a drive list box on Form1. 
  1791.  3. In the Click event of Form1, add the following code: 
  1792.          Sub Form_Click () 
  1793.                  Drive1.Width = Drive1.Width * 2 
  1794.          End Sub 
  1795.  4. Run the application (press F5). 
  1796.  5. Click on the down arrow on the drive box to display the list. 
  1797.  6. Choose a drive; everything works as it should. 
  1798.  7. Click on Form1; the width of the drive box changes. 
  1799.  8. Click on the down arrow on the drive box. 
  1800.  Note that the list fails to display. 
  1801. Title: Scroll Box Flashing Not Updated if Bar Resized with Focus 
  1802. Document Number: Q73839           Publ Date: 17-JUL-1991 
  1803. Product Name: Microsoft Visual Basic 
  1804. Product Version:  1.00 
  1805. Operating System: WINDOWS 
  1806.  
  1807.  Summary: 
  1808.  There is a Microsoft Windows version 3.0 problem updating the flashing 
  1809.  indicator for the scroll box on a vertical scroll bar. This Windows 
  1810.  problem affects vertical scroll bars in Microsoft Visual Basic 
  1811.  programming system version 1.0 for Windows. This article describes how 
  1812.  to work around the problem. 
  1813.  This information applies to Microsoft Visual Basic programming system 
  1814.  version 1.0 for Windows. 
  1815.  More Information: 
  1816.  Steps to Reproduce Problem 
  1817.  -------------------------- 
  1818.  1. Start Visual Basic and place a vertical scroll bar on a form. 
  1819.  2. Place the following code in the Form_Click event procedure: 
  1820.        Sub Form_Click () 
  1821.         VScroll1.Height = VScroll1.Height * 2 
  1822.        End Sub 
  1823.  3. From the Run menu, choose Start, or press F5 to run the example. 
  1824.  4. Click and drag the flashing scroll box (on the scroll bar) to 
  1825.     the middle (down from the top). 
  1826.  5. Click on the form to execute the Form_Click procedure, which 
  1827.     doubles the height of the scroll bar. Observe that the scroll box 
  1828.     correctly moved to the middle of the longer scroll bar, but the 
  1829.     flashing indicator failed to also move. 
  1830.  You can work around the problem by doing the following: 
  1831.  1. In step 2 above, add additional code so that the Form_Click 
  1832.     procedure appears as follows: 
  1833.        Sub Form_Click () 
  1834.         Const True = -1, False = 0 
  1835.         VScroll1.Height = VScroll1.Height * 2 
  1836.         VScroll1.Enabled = False 
  1837.         VScroll1.Enabled = True 
  1838.        End Sub 
  1839.  2. Follow the directions for steps 3, 4, and 5 above. You should 
  1840.     notice that the problem no longer exists. The flashing has 
  1841.     been updated correctly in the same position as the scroll box. 
  1842.  Microsoft has confirmed this to be a problem with Windows 3.0 
  1843.  (buglist3.00). We are researching this problem and will post new 
  1844.  information here as it becomes available. 
  1845. Title: UAE Changing Text1.Text or Label1.Caption in Form_LinkClose 
  1846. Document Number: Q74293           Publ Date: 18-JUL-1991 
  1847. Product Name: Microsoft Visual Basic 
  1848. Product Version:  1.00 
  1849. Operating System: WINDOWS 
  1850.  
  1851.  Summary: 
  1852.  Running a Visual Basic application under the following conditions will 
  1853.  result in a Windows Unrecoverable Application Error (UAE) message: 
  1854.  1. A DDE (dynamic data exchange) conversation has been established 
  1855.     with another application where Visual Basic is the server (for 
  1856.     example, another application such as Microsoft Excel for Windows 
  1857.     initiates the DDE conversation.) 
  1858.  2. The Text, Picture, or Caption property of a Textbox, Picture, or 
  1859.     Label is set within the LinkClose event procedure of a form. 
  1860.  The problem occurs for a program run in the Visual Basic development 
  1861.  environment or run as an .EXE program. The problem does not occur if 
  1862.  the Visual Basic application acts as the client (that is, initiates 
  1863.  the conversation) in a DDE conversation. 
  1864.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  1865.  programming system version 1.0 for Windows. We are researching this 
  1866.  problem and will post new information here as it becomes available. 
  1867.  More Information: 
  1868.  The problem occurs any time a control capable of DDE is changed within 
  1869.  the LinkClose event procedure of a form. Changing a control capable of 
  1870.  DDE causes Visual Basic to check all valid links. Because the 
  1871.  LinkClose event is incorrectly called before the DDE channel has been 
  1872.  fully deleted, Visual Basic treats the "partially" closed channel as a 
  1873.  valid link. A Windows UAE is generated as a result of Visual Basic 
  1874.  checking this invalid link. 
  1875.  To work around this problem, do the following: 
  1876.  1. Add a Timer control to the form. 
  1877.  2. Remove the code from the LinkClose event of Form1 and replace it 
  1878.     with: 
  1879.     Sub Form_LinkClose () 
  1880.        Timer1.Enabled = -1 
  1881.        Timer1.Interval = 10 
  1882.     End Sub 
  1883.  3. Add the following code to the Timer event of Timer1: 
  1884.     Sub Timer1_Timer () 
  1885.        Label1.Caption = "new caption" 
  1886.        'or Text1.Text = "new text" if using text box 
  1887.        Timer1.Enabled = 0 
  1888.     End Sub 
  1889.  When this is run and a LinkClose event occurs, the LinkClose event 
  1890.  will be allowed 10 milliseconds to finish, after which the desired 
  1891.  code will be executed (in the timer event) with no UAE. 
  1892.  Steps to Reproduce Problem 
  1893.  -------------------------- 
  1894.   1. Start Microsoft Word for Windows (WINWORD.EXE). 
  1895.   2. From the Macro menu, choose Edit. 
  1896.  3. Type "autoexec" (without the quotation marks) as the name of the 
  1897.     macro you want to create, and press ENTER. 
  1898.   4. Add the following lines of code: 
  1899.      Sub MAIN     'sets up DDE link with VB 
  1900.         ChanNum = DDEInitiate("uaetest","form1") 
  1901.         Print ChanNum  'To confirm that link has been established 
  1902.      End Sub 
  1903.   5. Exit Word for Windows and save all changes as you are prompted. 
  1904.   6. Start Microsoft Visual Basic (Form1 will automatically be created 
  1905.      by default). 
  1906.   7. Put a label box on Form1 (or a text box on Form1). 
  1907.   8. Add the following code to the LinkClose event of Form1: 
  1908.      Sub Form_LinkClose () 
  1909.         Label1.Caption = "new caption" 
  1910.         ' or Text1.Text = "new text" if using TextBox 
  1911.      End Sub 
  1912.   9. From the File menu of Visual Basic, Save the file as Uaetest.Frm. 
  1913.  10. From the File menu of Visual Basic, Save the project as Uaetest.Mak. 
  1914.  11. Run Uaetest. 
  1915.  12. Start Windows. It will automatically run the macro to establish 
  1916.      the DDE link. This can be confirmed by the number 1 showing up on 
  1917.      the status line in Word for Windows. 
  1918.  13. Exit Word for Windows. 
  1919.  14. A UAE message will be displayed. 
  1920. Title: Problem Clicking Properties List Box on Maximized Form 
  1921. Document Number: Q74336           Publ Date: 22-JUL-1991 
  1922. Product Name: Microsoft Visual Basic 
  1923. Product Version:  1.00 
  1924. Operating System: WINDOWS 
  1925.  
  1926.  Summary: 
  1927.  At design time in the Microsoft Visual Basic (VB.EXE) environment, you 
  1928.  cannot assign properties to controls on a form that is maximized 
  1929.  unless the Code window is also displayed. The general problem is that 
  1930.  if you press the ALT key to activate the Properties bar over a form of 
  1931.  any size, you cannot access the Properties list box unless the Code 
  1932.  window is currently in front of the form. 
  1933.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  1934.  programming system version 1.0 for Windows. We are researching this 
  1935.  problem and will post new information here as it becomes available. 
  1936.  More Information: 
  1937.  To work around the problem, put the Code window in front of the form 
  1938.  (this can be done by double-clicking a control), then you can access 
  1939.  the Properties list box and Settings box with the mouse. As an 
  1940.  alternative, when the form is not maximized and when the Properties 
  1941.  bar is at least partially visible, you can activate the Properties bar 
  1942.  with the mouse instead of with the ALT key. 
  1943.  Steps to Reproduce Problem 
  1944.  -------------------------- 
  1945.  1. From the File menu, choose New Project. 
  1946.  2. Optionally, add any control (such as a picture box) to Form1. 
  1947.  3. Click the maximize button (in the upper right corner) on Form1 such 
  1948.     that it fills the entire screen. 
  1949.  4. Press the ALT key to display the Properties bar. You now can 
  1950.     correctly use the arrow keys or mouse to pull down the menus 
  1951.     and choose commands from the main menu. The problem is that if 
  1952.     you try to click on the Properties list box, the entire main menu 
  1953.     disappears, preventing you from changing properties. 
  1954. Title: Spaces Can Make Words Wrap Too Soon in Windows Label Control 
  1955. Document Number: Q74337           Publ Date: 22-JUL-1991 
  1956. Product Name: Microsoft Visual Basic 
  1957. Product Version:  1.00 
  1958. Operating System: WINDOWS 
  1959.  
  1960.  Summary: 
  1961.  Embedded spaces can cause words to wrap too soon within a label box in 
  1962.  Microsoft Visual Basic programming system version 1.0 for Windows. The 
  1963.  problem is not with Visual Basic, but rather with Windows. 
  1964.  Microsoft has confirmed this to be a problem in Windows version 3.0 
  1965.  (buglist3.00). We are researching this problem and will post new 
  1966.  information here as it becomes available. 
  1967.  More Information: 
  1968.  Steps to Reproduce Problem 
  1969.  -------------------------- 
  1970.  1. From the File menu, choose New Project. 
  1971.  2. Draw a label box on the form starting from the left side of 
  1972.     the form. 
  1973.  3. Set the width property of the label to 6975 twips (twips is the 
  1974.     default scale mode). 
  1975.  4. Set the height property of the label to 495 twips. 
  1976.  5. From the Properties list box, choose the Caption property for the 
  1977.     Label1 box. Enter the following caption in the Settings box, typing 
  1978.     10 spaces between digits instead of the ... (ellipses) shown: 
  1979.        1...2...3...4...5...6...7...8...9 
  1980.     As you can see, the 9 is incorrectly placed on the next line of the 
  1981.     label box, even though more than enough room exists to place the 
  1982.     entire caption in one line. 
  1983.  You can correct this problem by changing the width of the label to 
  1984.  7095 twips or more. 
  1985. Title: File, List Controls 2 Pixels High at Design Time (Grid Align) 
  1986. Document Number: Q74347           Publ Date: 19-JUL-1991 
  1987. Product Name: Microsoft Visual Basic 
  1988. Product Version:  1.00 
  1989. Operating System: WINDOWS 
  1990.  
  1991.  Summary: 
  1992.  When the "Align to grid" option is on, Visual Basic's list box and 
  1993.  file list box controls may not assume the correct minimum height when 
  1994.  you draw them shorter than two grid lines at design time. This can 
  1995.  result in a list box or file list box control that appears only 2 
  1996.  pixels (30 twips) high at design time. Visual Basic automatically 
  1997.  resizes other controls to the minimum height if they were drawn too 
  1998.  short. 
  1999.  Microsoft has confirmed this to be a problem with Microsoft Visual 
  2000.  Basic programming system version 1.0 for Windows. We are researching 
  2001.  this problem and will post new information here as it becomes 
  2002.  available. 
  2003.  The problem is not serious, because simply running the program causes 
  2004.  the control to correctly resize to the default minimum height. 
  2005.  More Information: 
  2006.  Steps to Reproduce Problem 
  2007.  -------------------------- 
  2008.  1. Start Microsoft Visual Basic. From the Edit menu, choose Grid 
  2009.     Settings and activate (check) the "Align to grid" option. 
  2010.  2. Click on the list box control, or file list box control, in 
  2011.     the Toolbox. 
  2012.  3. Click on Form1 and drag the mouse across the form horizontally 
  2013.     without moving the mouse vertically. 
  2014.  4. Release the mouse button, and the control will fail to be resized 
  2015.     to the default minimum height (two grid lines). The control may be as 
  2016.     small as 2 pixels (30 twips) high. 
  2017.  Note that running the program causes the control to correctly resize 
  2018.  to the default minimum height (two grid lines). 
  2019. Title: F5 in Run Mode with Focus on Main Menu Bar Acts as CTRL+BREAK 
  2020. Document Number: Q74348           Publ Date: 19-JUL-1991 
  2021. Product Name: Microsoft Visual Basic 
  2022. Product Version:  1.00 
  2023. Operating System: WINDOWS 
  2024.  
  2025.  Summary: 
  2026.  A Visual Basic program will break at run time under the following 
  2027.  simultaneous conditions: 
  2028.  1. You run the program in the Visual Basic development environment. 
  2029.  2. The Visual Basic menu bar has the focus. 
  2030.  3. You press F5. 
  2031.  The program will break when the F5 key is pressed and the Immediate 
  2032.  Window will get the focus. This is not a problem with Visual Basic, 
  2033.  but rather a design feature. 
  2034.  This information only applies to an application run in the Visual 
  2035.  Basic development environment, not as an .EXE program. 
  2036.  This information applies to Visual Basic programming system version 
  2037.  1.0 for Windows 
  2038.  More Information: 
  2039.  The F5 key acts as the shortcut key for the Visual Basic Run menu. 
  2040.  Because Start, Continue, and Break all share the same menu item under 
  2041.  the Run menu, F5 acts differently depending upon the state of 
  2042.  execution of a program. It acts as the Run key in the Visual Basic 
  2043.  1.0 environment. It also serves as the Break key once the application 
  2044.  is running and the focus is on the Visual Basic menu bar. After 
  2045.  execution has been "broken" with the break key, the F5 key serves as 
  2046.  the Continue key. 
  2047.  To demonstrate the different modes of the F5 key, do the following: 
  2048.  1. Run Visual Basic. 
  2049.  2. From the File menu, select New Project (ALT, F, N). 
  2050.  3. Press F5 to run the program. 
  2051.  4. Using the mouse, click on the Visual Basic menu bar. 
  2052.  5. Press F5 to break the program. The Immediate window will be given 
  2053.     the focus after you press F5. 
  2054.  6. Press F5 again to continue execution of the program. 
  2055. Title: VB Syntax Error Appending : Lines to Sub or Function Statement 
  2056. Document Number: Q74407           Publ Date: 19-JUL-1991 
  2057. Product Name: Microsoft Visual Basic 
  2058. Product Version:  1.00 
  2059. Operating System: WINDOWS 
  2060.  
  2061.  Summary: 
  2062.  A syntax error may occur when a Sub or Function statement is followed 
  2063.  by another statement on the same line, even when separated by a colon 
  2064.  (:). 
  2065.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  2066.  programming system version 1.0 for Windows. We are researching this 
  2067.  problem and will post new information here as it becomes available. 
  2068.  More Information: 
  2069.  To illustrate the problem, type the following code onto a single line 
  2070.  within a Code window: 
  2071.     Sub Foo() : Print "Hello, World" : End Sub 
  2072.  An "Invalid outside Sub or Function" error occurs when you move the 
  2073.  cursor from this line. 
  2074.  If the Sub procedure Foo() already exists, 
  2075.     Sub Foo() 
  2076.     End Sub 
  2077.  then you can add code after the procedure heading, Sub Foo(), if 
  2078.  separated by a colon, as follows: 
  2079.     Sub Foo() : Print "Hello World" 
  2080.     End Sub 
  2081.  Although it is possible to use more than one statement on the same 
  2082.  line with a procedure heading, Microsoft does not recommend this. A 
  2083.  procedure heading should always be on a line by itself. 
  2084. Title: "Path Not Found: 'T:'" if Hyphen Precedes Directory Name 
  2085. Document Number: Q74408           Publ Date: 19-JUL-1991 
  2086. Product Name: Microsoft Visual Basic 
  2087. Product Version:  1.00 
  2088. Operating System: WINDOWS 
  2089.  
  2090.  Summary: 
  2091.  The error message "Path not found: 'T:'" will occur if you try to open 
  2092.  a project with a directory name that is preceded with a hyphen (for 
  2093.  example, -TEST) in Microsoft Visual Basic programming system version 
  2094.  1.0 for Windows. The problem is due to the way Windows 3.0 interprets 
  2095.  directories with the Windows API function DlgDirSelect. The following 
  2096.  example reproduces the problem. 
  2097.  Steps to Reproduce Problem 
  2098.  -------------------------- 
  2099.  1. Create a temporary directory named -TEST (a hyphen followed by 
  2100.     TEST) in your Visual Basic directory. 
  2101.  2. Start Visual Basic. From the File menu, choose Open Project. 
  2102.  3. You should be able to see the "-TEST" directory in the list box. 
  2103.     Try selecting or clicking on that directory. The error message 
  2104.     "Path not found: 'T:'" will be displayed. 
  2105.  Microsoft has confirmed this to be a problem in the Windows 3.0 
  2106.  operating environment (BUGLIST3.00). We are researching this problem 
  2107.  and will post new information here as it becomes available. 
  2108. Title: Mouse Pointer Disappears in Code Window if ESC or CTRL+BREAK 
  2109. Document Number: Q74409           Publ Date: 19-JUL-1991 
  2110. Product Name: Microsoft Visual Basic 
  2111. Product Version:  1.00 
  2112. Operating System: WINDOWS 
  2113.  
  2114.  Summary: 
  2115.  In Microsoft Visual Basic, the mouse pointer fails to be displayed if 
  2116.  you press ESC or CTRL+BREAK within the Code window. (The mouse pointer 
  2117.  correctly reappears if you move the mouse.) 
  2118.  Microsoft has confirmed this to be a problem with Microsoft Visual 
  2119.  Basic programming system version 1.0 for Windows. We are researching 
  2120.  this problem and will post new information here as it becomes 
  2121.  available. 
  2122.  More Information: 
  2123.  Steps to Reproduce Problem 
  2124.  -------------------------- 
  2125.  1. Start Visual Basic with a New Project. 
  2126.  2. Double-click on the form to bring up the Code window. Notice the 
  2127.     I-beam mouse pointer within the Code window. If you place the 
  2128.     mouse pointer outside of the Code window, you will see the I-beam 
  2129.     change to an arrow. 
  2130.  3. Place the mouse pointer back in the Code window to display the 
  2131.     I-beam pointer. Press either the ESC key or the key combination 
  2132.     CTRL+BREAK. The I-beam mouse pointer will temporarily disappear. 
  2133.  4. The pointer will be redisplayed if you move the mouse. 
  2134. Title: Saving VB Project Changes Design-Time WindowState Property 1,2 
  2135. Document Number: Q74446           Publ Date: 22-JUL-1991 
  2136. Product Name: Microsoft Visual Basic 
  2137. Product Version:  1.00 
  2138. Operating System: WINDOWS 
  2139.  
  2140.  Summary: 
  2141.  In the Properties list box, setting the WindowState property of a 
  2142.  form to either "1 - Minimized" or "2 - Maximized" at design time 
  2143.  incorrectly displays "0 - Normal" after you run the program. When you 
  2144.  run the application again, your last WindowState setting (1 or 2) is 
  2145.  correctly remembered, even though the Properties list box incorrectly 
  2146.  displays "0 - Normal". However, if you save the project, the value for 
  2147.  the WindowState property (1 or 2) will be forgotten, and will 
  2148.  incorrectly return to "0 - Normal". 
  2149.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  2150.  programming system version 1.0 for Windows. We are researching the 
  2151.  problem and will post new information here as it becomes available. 
  2152.  More Information: 
  2153.  Steps to Reproduce Problem 
  2154.  -------------------------- 
  2155.  1. In the Properties list box, change the WindowState property of a 
  2156.     form to "1 - Minimized" or "2 - Maximized". 
  2157.  2. From the Run menu, choose Start. 
  2158.  3. From the Run menu, choose End. Notice that the WindowState property 
  2159.     in the Properties list box incorrectly displays "0 - Normal". 
  2160.  4. When you run the program again, the Form1 will correctly be 
  2161.     minimized (1) or maximized (2), showing that the value for 
  2162.     WindowState is remembered. 
  2163.  5. If you save the project and run again, the value set for the 
  2164.     WindowState property is incorrectly reset to "0 - Normal". 
  2165.  To work around this problem, you can set the WindowState property in 
  2166.  the Form_Load event procedure (instead of setting WindowState in the 
  2167.  Properties list box at design time). If you place the following line 
  2168.  of code in the Form_Load event procedure, the application will always 
  2169.  start up maximized: 
  2170.     WindowState = 2    ' 0=normal window; 1=minimized; 2=maximized 
  2171. Title: "Unresolved External" Attempting to Use CDK VBDirtyForm() 
  2172. Document Number: Q74338           Publ Date: 25-JUL-1991 
  2173. Product Name: Microsoft Visual Basic 
  2174. Product Version:  1.00 
  2175. Operating System: WINDOWS 
  2176.  
  2177.  Summary: 
  2178.  The VBAPI routine VBDirtyForm() is documented within Visual Basic's 
  2179.  add-on Control Development Kit (CDK) and is defined with the CDK 
  2180.  Header file, VBAPI.H. However, the LINK.EXE error "Unresolved 
  2181.  external" occurs when linking your DLL if you attempt to use this 
  2182.  function, because VBDirtyForm() does not actually exist. 
  2183.  This information applies to Microsoft Visual Basic programming system 
  2184.  version 1.0 for Windows. Microsoft has confirmed this to be a problem 
  2185.  and will post additional information here as it becomes available. 
  2186.  More Information: 
  2187.  The functionality of VBDirtyForm() can easily be achieved using 
  2188.  VBSetControlProperty() to assign a value to any property that has been 
  2189.  defined with the property flags of PF_fSaveData and/or PF_fSaveMsg. 
  2190.  When a property is assigned a value that was defined with one or both 
  2191.  of the property flags, PF_fSaveData or PF_fSaveMsg, VB.EXE takes care 
  2192.  of writing the property value to disk when the form is saved, and is 
  2193.  made aware of any changes made to any property of any control or the 
  2194.  form itself. Thus, VB.EXE knows to save the form when exiting or 
  2195.  opening a new project. 
  2196. Title: WINAPI.TXT: Windows API Declarations and Constants for VB 
  2197. Document Number: Q73694           Publ Date: 29-JUL-1991 
  2198. Product Name: Microsoft Visual Basic 
  2199. Product Version:  1.00 
  2200. Operating System: WINDOWS 
  2201.  
  2202.  Summary: 
  2203.  The file WINAPI.TXT supplies declarations for Microsoft Visual Basic 
  2204.  programmers who want to call Windows API routines. 
  2205.  This information applies to Microsoft Visual Basic programming system 
  2206.  version 1.0 for Windows. 
  2207.  WINAPI.TXT can be found in the Software/Data Library by searching on 
  2208.  the word BV0447, the Q number of this article, or S13104. BV0447 was 
  2209.  archived using the PKware file-compression utility. After you 
  2210.  decompress BV0447, you will obtain the following two files: 
  2211.     WINAPI.TXT 
  2212.     README.NOW 
  2213.  WINAPI.TXT is provided here in the assumption that you already have a 
  2214.  reference for Windows API calls, such as the documentation provided 
  2215.  with the Microsoft Windows Software Development Kit (SDK). 
  2216.  If you don't have a reference manual for Windows API calls, you can 
  2217.  obtain the Visual Basic add-on kit number 1-55615-413-5, "Microsoft 
  2218.  Windows Programmer's Reference" and Online Resource (which includes 
  2219.  WINAPI.TXT on disk), available at a charge from Microsoft. 
  2220.  More Information: 
  2221.  WINAPI.TXT can be found on CompuServe in the MSLANG forum (GO MSLANG), 
  2222.  as well as in the Microsoft Software Library on CompuServe. 
  2223.  Contents of README.NOW 
  2224.  ---------------------- 
  2225.  WINAPI.TXT is an ASCII text file containing the functions and 
  2226.  constants in the Microsoft Windows 3.0 API, declared in the format 
  2227.  used by Microsoft Visual Basic. 
  2228.  To use WINAPI.TXT, you must have the book "Microsoft Windows 
  2229.  Programmer's Reference" for Windows version 3.0 (published by 
  2230.  Microsoft Press, 1990), or you must have the reference manuals 
  2231.  provided with the Microsoft Windows SDK. 
  2232.  WINAPI.TXT includes the following: 
  2233.   - External procedure declarations for all the Microsoft Windows API 
  2234.     functions that can be called from Visual Basic. 
  2235.   - Global constant declarations for all the constants used by the 
  2236.     Microsoft Windows API. 
  2237.   - Type declarations for the user-defined types (structures) used by 
  2238.     the Microsoft Windows API. 
  2239.  WINAPI.TXT is too large to be loaded directly into a Visual Basic 
  2240.  module. Attempting to load it directly into Visual Basic will cause an 
  2241.  "Out of Memory" error message. 
  2242.  WINAPI.TXT is also too large for the Notepad editor supplied with 
  2243.  Microsoft Windows, but it can be loaded by Microsoft Write. To use 
  2244.  WINAPI.TXT, load it into an editor (such as Microsoft Write) that can 
  2245.  handle large files. Copy the declarations you want and paste them into 
  2246.  the global module in your Visual Basic application. 
  2247.  Note: Some of the Windows API declarations are very long. Some editors 
  2248.  will wrap these onto a second line, and will copy them as multiple 
  2249.  lines rather than a single line. Declarations in Visual Basic cannot 
  2250.  span lines, so if you paste these as multiple lines, Visual Basic will 
  2251.  report an error. If an error occurs, you can either adjust the margins in 
  2252.  the editor before copying or remove the line break after pasting. 
  2253.  The global module is the recommended place for the declarations that 
  2254.  you copy from the WINAPI.TXT file; however, you can place the external 
  2255.  procedure declarations in the Declarations section of any form or 
  2256.  module. You can also place the constant declarations anywhere in any 
  2257.  module or form code if you remove the Global keyword. Type 
  2258.  declarations must be placed in the global module. 
  2259.  Once you have pasted the declaration for a Windows API routine (as 
  2260.  well as any associated constant and type declarations) into your 
  2261.  application, you can call that routine as you would call any Visual 
  2262.  Basic procedure. 
  2263.  For more information about declaring and calling external procedures, 
  2264.  see Chapter 23, "Extending Visual Basic," in "Microsoft Visual 
  2265.  Basic: Programmer's Guide." 
  2266.  Warning 
  2267.  ------- 
  2268.  Visual Basic cannot verify the data you pass to Microsoft Windows API 
  2269.  routines. Calling a Microsoft Windows API routine with an invalid 
  2270.  argument can result in unpredictable behavior: your application, 
  2271.  Visual Basic, or Windows may crash or hang. When experimenting with 
  2272.  Windows API routines, save your work often. 
  2273. Title: "Overflow" Printing Too Large a String to Form or Printer 
  2274. Document Number: Q74517           Publ Date: 29-JUL-1991 
  2275. Product Name: Microsoft Visual Basic 
  2276. Product Version:  1.00 
  2277. Operating System: WINDOWS 
  2278.  
  2279.  Summary: 
  2280.  An "Overflow" error message may occur when you print a long string in 
  2281.  Microsoft Visual Basic. 
  2282.  When a character is printed using the Print method, the CurrentX and 
  2283.  CurrentY coordinates are also updated for the object being printed to. 
  2284.  If the string being printed is long enough to cause the value of the 
  2285.  CurrentX property to exceed 32,767 twips, an "Overflow" error will 
  2286.  occur. This behavior is by design. 
  2287.  "Overflow" can be caused by printing a single long string or by 
  2288.  repeatedly printing shorter strings that are appended onto the end of 
  2289.  the last string (using the Visual Basic semicolon (;) operator). 
  2290.  This information applies to Microsoft Visual Basic programming system 
  2291.  version 1.0 for Windows. 
  2292.  More Information: 
  2293.  Steps to Reproduce Problem 
  2294.  -------------------------- 
  2295.  1. Start Visual Basic or choose New Project from the File menu. 
  2296.  2. Place a label control on Form1. 
  2297.  3. Add the following code to the Form_Click event: 
  2298.          Sub Form_Click() 
  2299.              For index% = 1 to 1000 
  2300.                  Print "A"; 
  2301.                  Label1.Caption = Str$(CurrentX) 
  2302.              Next 
  2303.          End Sub 
  2304.  4. From the Run menu, choose Start. 
  2305.  5. Click on Form1. 
  2306.  An "Overflow" error will occur. You can examine the label caption to 
  2307.  see that the value of Form1.CurrentX plus the TextWidth of "A" 
  2308.  exceeded 32767 at the time of the error. 
  2309. Title: No Beep when You Click on Form while Menu Design Window Is Up 
  2310. Document Number: Q74518           Publ Date: 29-JUL-1991 
  2311. Product Name: Microsoft Visual Basic 
  2312. Product Version:  1.00 
  2313. Operating System: WINDOWS 
  2314.  
  2315.  Summary: 
  2316.  The Menu Design window, used to create pull-down menus for your Visual 
  2317.  Basic form(s), is a modal dialog box. Because the Menu Design window 
  2318.  is a modal dialog box, clicking on any other Visual Basic window when 
  2319.  the Menu Design window is visible should fail to transfer the focus 
  2320.  and should generate a beep to notify you that you cannot act outside 
  2321.  the dialog box. 
  2322.  However, clicking on the Visual Basic form for which the Menu design 
  2323.  window is opened does not generate a beep. All other Visual Basic 
  2324.  windows, such as the ToolBox, Color Palette, Project Window, and main 
  2325.  Visual Basic menu bar all respond with a beep when the Menu Design 
  2326.  window is active. Focus is maintained by the Menu Design window in 
  2327.  both cases. 
  2328.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  2329.  programming system version 1.0 for Windows. We are researching this 
  2330.  problem and will post new information here as it becomes available. 
  2331. Title: Control Overlaid by Another Control Fails to Refresh if Moved 
  2332. Document Number: Q74519           Publ Date: 29-JUL-1991 
  2333. Product Name: Microsoft Visual Basic 
  2334. Product Version:  1.00 
  2335. Operating System: WINDOWS 
  2336.  
  2337.  Summary: 
  2338.  Visual Basic does not support overlapping controls. Having overlapping 
  2339.  controls can result in portions of a control not refreshing correctly. 
  2340.  If controls are moved over each other, then one or both of the 
  2341.  controls may not correctly refresh even when the controls are moved 
  2342.  apart. This is known to happen when controls are resized at run time 
  2343.  using the Move method or by changing the Height and Width properties 
  2344.  as a result of a Form_Resize event. Because controls must be resized 
  2345.  one at a time, it is possible that one control will briefly overlap 
  2346.  another control during the resize process at run time. The control 
  2347.  that was briefly overlapped may not refresh properly. An example of 
  2348.  this behavior is given further below. 
  2349.  This behavior can be improved by performing the Refresh method 
  2350.  (CtrlName.Refresh) on every overlapping control at run time, after an 
  2351.  overlapped control has been moved or after a form that contains 
  2352.  overlapping controls has been resized. 
  2353.  This is not a problem with Visual Basic, but the nature of overlapping 
  2354.  controls under Visual Basic. This behavior occurs at run time in the 
  2355.  Visual Basic development environment or as an .EXE program. 
  2356.  This information applies to the Visual Basic programming system 
  2357.  version 1.0 for Windows. 
  2358.  More Information: 
  2359.  For more information about Visual Basic and overlapping controls, 
  2360.  query in this knowledge base on the following words: 
  2361.     overlapping and controls and Visual and Basic 
  2362.  Steps to Reproduce Problem 
  2363.  -------------------------- 
  2364.  1. From the File menu, choose New Project (ALT, F, P). 
  2365.  2. Add a picture control (Picture1) to the default form (Form1). 
  2366.  3. Add a command button (Command1) to Form1. 
  2367.  4. Add a vertical scroll bar (VScroll1) to Form1. 
  2368.  5. Using the mouse, double-click on Form1 to bring up the code 
  2369.     window. 
  2370.  6. Within the Resize event procedure of Form1, add the following code: 
  2371.       Sub Form_Resize () 
  2372.           Picture1.Move 0, 0, ScaleWidth - VScroll1.Width, _ 
  2373.                         ScaleHeight - Command1.Height 
  2374.           VScroll1.Move ScaleWidth - VScroll1.Width, 0, _ 
  2375.                         VScroll1.Width, ScaleHeight - Command1.Height 
  2376.           Command1.Move 0, ScaleHeight - Command1.Height, _ 
  2377.                         ScaleWidth, Command1.Height 
  2378.       End Sub 
  2379.  Note: The underscores (_) in the above code example indicate that 
  2380.  the line should be concatenated with the next line in the Visual Basic 
  2381.  environment (VB.EXE). 
  2382.  7. Run the program. 
  2383.  8. Using the mouse, resize the form by extending the bottom or right 
  2384.     sides. When the bottom edge of the form is extended, the command 
  2385.     button (Command1) will not refresh. When the right edge of Form1 
  2386.     is extended, the scroll bar will not refresh. The refresh problems 
  2387.     are caused because Picture1 is expanded and temporarily overlaps 
  2388.     the control. When the control (VScroll1 or Command1) is moved out 
  2389.     of the way, it is not refreshed. 
  2390.  To work around this behavior, use the Refresh method for Picture1, 
  2391.  VScroll1, and Command1 after the controls have be moved. Add the 
  2392.  following statements to Sub Form_Resize (after the Command1.Move 
  2393.  statement) above to overcome the behavior: 
  2394.     Picture1.Refresh 
  2395.     VScroll1.Refresh 
  2396.     Command1.Refresh 
  2397. Title: Incorrectly Accessing System Menu of Hidden Form 
  2398. Document Number: Q74564           Publ Date: 29-JUL-1991 
  2399. Product Name: Microsoft Visual Basic 
  2400. Product Version:  1.00 
  2401. Operating System: WINDOWS 
  2402.  
  2403.  Summary: 
  2404.  It is possible under certain circumstances to incorrectly access the 
  2405.  system menu of a hidden form in Visual Basic. 
  2406.  Steps to Reproduce Problem 
  2407.  -------------------------- 
  2408.  1. Start Visual Basic or choose New Project from the File menu. 
  2409.  2. Set the WindowState property of Form1 to 1 (minimized). 
  2410.  3. Enter the following line of code in the Form_Resize event 
  2411.     procedure of Form1: 
  2412.        If WindowState = 2 Then Hide    'WindowState 2 = maximized 
  2413.  4. From the Run menu, choose Start. 
  2414.  5. Click on the Form1 icon to bring up the system menu for Form1. 
  2415.  6. From the the Form1 system menu, choose Maximize. Form1 will maximize 
  2416.     and then hide. 
  2417.  7. Press ALT+SPACE to activate the Form1 system menu. 
  2418.  A system menu will appear in the upper left corner of the screen, even 
  2419.  though Form1 is hidden. 
  2420.  Microsoft has confirmed this to problem with Microsoft Visual Basic 
  2421.  programming system 1.0 for Windows. We are researching this problem 
  2422.  and will post new information here as it becomes available. 
  2423. Title: Incomplete Path Causes "Insufficient Disk Space" During Setup 
  2424. Document Number: Q74646           Publ Date: 29-JUL-1991 
  2425. Product Name: Microsoft Visual Basic 
  2426. Product Version:  1.00 
  2427. Operating System: WINDOWS 
  2428.  
  2429.  Summary: 
  2430.  You may receive an "Insufficient disk space on: XXX" error message 
  2431.  when running the Microsoft Visual Basic version 1.0 Setup program if 
  2432.  you have not specified a drive letter in your path to Windows 3.0. 
  2433.  This information applies to Microsoft Visual Basic programming system 
  2434.  version 1.0 for Windows. 
  2435.  More Information: 
  2436.  If you have a partial PATH to the Windows environment (for example, 
  2437.  PATH=\WIN3) in your AUTOEXEC.BAT file, you may need to reset the PATH 
  2438.  to C:\WIN3. After you reset the path, Setup should run correctly. 
  2439. Title: "Insufficient Disk Space" After Setup Begins to Copy Files 
  2440. Document Number: Q74648           Publ Date: 29-JUL-1991 
  2441. Product Name: Microsoft Visual Basic 
  2442. Product Version:  1.00 
  2443. Operating System: WINDOWS 
  2444.  
  2445.  Summary: 
  2446.  If you receive an "Insufficient disk space" error message when running 
  2447.  Visual Basic's Setup program, it may be caused by using Windows with a 
  2448.  temporary Windows swap file instead of the permanent Windows swap 
  2449.  file. 
  2450.  This information applies to Microsoft Visual Basic programming system 
  2451.  version 1.0 for Windows. 
  2452.  More Information: 
  2453.  Pages 520 through 529 in the "Microsoft Windows User's Guide" version 
  2454.  3.0 manual discuss Windows swap files. Permanent swap files are 
  2455.  contiguous so that your disk does not contain files in fragmented 
  2456.  pieces, which may happen if you are using temporary swap files. 
  2457.  Temporary Windows swap files may grow in size, which may cause the 
  2458.  "Insufficient disk space" error during the execution of Visual Basic's 
  2459.  Setup program. However, permanent Windows swap files will not change 
  2460.  in size, so using permanent Windows swap files may help to avoid the 
  2461.  "Insufficient disk space" error. 
  2462. Title: EVENTINFO Topic Correction for VB CDK VBAPI.HLP File 
  2463. Document Number: Q74649           Publ Date: 29-JUL-1991 
  2464. Product Name: Microsoft Visual Basic 
  2465. Product Version:  1.00 
  2466. Operating System: WINDOWS 
  2467.  
  2468.  Summary: 
  2469.  Below is a correction to the VBAPI.HLP file provided in the Microsoft 
  2470.  Visual Basic Control Development Kit (add-on kit number 046-050-022). 
  2471.  In the VBAPI.HLP file, for the structure topic named EVENTINFO, a 
  2472.  column title is incorrectly labeled "Flag Value," but should instead 
  2473.  be labeled "Field Name." 
  2474.  This information applies to Microsoft Visual Basic programming system 
  2475.  version 1.0 for Windows. 
  2476. Title: Visual Basic Add-on Kits: CDK, Windows Reference, 360K Disks 
  2477. Document Number: Q72265           Publ Date: 30-JUL-1991 
  2478. Product Name: Microsoft Visual Basic 
  2479. Product Version:  1.00 
  2480. Operating System: WINDOWS 
  2481.  
  2482.  Summary: 
  2483.  Microsoft has developed the following add-on kits to help Visual Basic 
  2484.  programming-system users get even more from the product. You may call 
  2485.  Microsoft End User Sales and Service at (800) 426-9400 to order these 
  2486.  kits (except kit no. 5 below). Please note the specific requirements for 
  2487.  the kits: 
  2488.  1. "Microsoft Windows Programmer's Reference" book and Online Resource 
  2489.     This complete reference to the Microsoft Windows API includes the 
  2490.     following: 
  2491.     a. A comprehensive 1152-page reference book for Windows 3.0 
  2492.        (published by Microsoft Press, 1990) 
  2493.     b. Online references to each component of the Windows API in 
  2494.        Windows Help format. Includes both 5.25-inch and 3.5-inch disks. 
  2495.     c. WINAPI.TXT: Function, Type, and Constant declarations in Visual 
  2496.        Basic format for nearly every Windows API function. Note: A 
  2497.        correction for the WINAPI.TXT file dated 5/14/91 is described in 
  2498.        a separate article in this knowledge base. To find that article, 
  2499.        query on the following words: WINAPI.TXT and correction. 
  2500.     d. APIXREF.HLP: Quick reference listing the value of every constant 
  2501.        and the appropriate library for every function. 
  2502.     Kit number: 1-55615-413-5 
  2503.     Price: $49.95 (plus shipping/and handling and applicable sales tax) 
  2504.  2. Microsoft Visual Basic Control Development Kit (CDK) 
  2505.     This kit enables you to develop Visual Basic controls to extend the 
  2506.     Visual Basic Toolbox to meet your specific needs. Custom controls 
  2507.     can be placed on forms and used just like built-in controls. You 
  2508.     determine the appearance and functionality -- including properties 
  2509.     and events -- of each control. Includes both 5.25-inch and 3.5-inch 
  2510.     disks. 
  2511.     Requires: Microsoft Windows Software Development Kit (SDK) (version 
  2512.     3.0 or later) and Microsoft C compiler (version 6.0 or later) 
  2513.     Note: Custom controls are written in C and require extensive 
  2514.     knowledge of the Windows API. 
  2515.     Kit number: 046-050-022 
  2516.     Price: $49.95 (plus shipping/handling and applicable sales tax) 
  2517.  3. Microsoft Windows Help Compiler 
  2518.     The Windows Help system lets you provide online Help to those using 
  2519.     your Visual Basic application. Supports hypertext links and 
  2520.     context-sensitive Help screens, using the Windows Help engine. 
  2521.     Includes both 5.25-inch and 3.5-inch disks. Includes a sample help 
  2522.     file and a sample Visual Basic program (which doubles as an 
  2523.     application to test help files). 
  2524.     Requires: An RTF (rich text formatting) text editor, such as 
  2525.     Microsoft Word for Windows. 
  2526.     Kit number: 046-050-052 
  2527.     Price: $49.95 (plus shipping/handling and applicable sales tax) 
  2528.  4. Visual Basic Low-Density (360K) 5.25-inch Disks 
  2529.     If your hardware cannot accommodate the high-density (1.2 MB) 
  2530.     5.25-inch disks or low-density (720K) 3.5-inch disks included in 
  2531.     the Visual Basic programming system package, you may order 
  2532.     low-density (360K) 5.25-inch disks for the program. 
  2533.     Kit number: 046-050-004 
  2534.     Price: free (pay only shipping/handling) 
  2535.  The following kit for Microsoft SQL Server developers includes a copy 
  2536.  of Visual Basic (contact Microsoft On-line Sales at 1 (800) 443-4672 
  2537.  for more information): 
  2538.  5. Windows-Based Visual Basic Library and Software Development Kit 
  2539.     (SDK) for Microsoft SQL Server 
  2540.     Contains SQL programming libraries, a preliminary documentation 
  2541.     set, and a copy of Visual Basic programming system. Allows Visual 
  2542.     Basic programmers to quickly develop rich Microsoft Windows graphical 
  2543.     client-server applications for Microsoft SQL Server. Developers can 
  2544.     also use Visual Basic Library for SQL Server with the Database 
  2545.     Gateway(TM) from Micro Decisionware, Boulder, Colo., to build 
  2546.     graphical applications that tap DB2 (TM) and other IBM mainframe 
  2547.     data sources. 
  2548.     (Microsoft SQL Server is an intelligent client-server relational 
  2549.     database-management system (RDBMS) for PC networks. Providing 
  2550.     capabilities previously the exclusive domain of mainframe and 
  2551.     minicomputer systems, Microsoft SQL Server brings high-end 
  2552.     performance, security, and data integrity to local area networks, 
  2553.     allowing data to be shared safely among many applications and 
  2554.     users. Microsoft SQL Server is supported by popular networks such 
  2555.     as Microsoft LAN Manager, Novell NetWare, and IBM LAN Server.) 
  2556.     Visual Basic Library for SQL Server is available as a Software 
  2557.     Development Kit. It is available directly from Microsoft for $495. 
  2558.     Contact Microsoft On-line Sales at 1 (800) 443-4672 for sales and 
  2559.     support information. For pricing and availability outside the U.S., 
  2560.     please contact your local Microsoft subsidiary. 
  2561.  The above information is accurate as of July 29, 1991, and is subject 
  2562.  to change. 
  2563. Title: No Title for Project Window After Loading from Command Line 
  2564. Document Number: Q74677           Publ Date: 30-JUL-1991 
  2565. Product Name: Microsoft Visual Basic 
  2566. Product Version:  1.00 
  2567. Operating System: WINDOWS 
  2568.  
  2569.  Summary: 
  2570.  A naming problem can occur when you invoke the VB.EXE (Visual Basic) 
  2571.  environment with a project from the Windows command line with a .FRM, 
  2572.  .BAS, or a .VBX filename extension. If you start a project with any of 
  2573.  these extensions, you will see an untitled Project Window displayed, 
  2574.  and if you make any changes to that Form and try to exit Visual Basic, 
  2575.  Visual Basic will correctly prompt you to save the changes to that 
  2576.  Form. However, if you first select New Form to add to the Project, you 
  2577.  will be prompted to save the forms and to save the project under a 
  2578.  blank project name. The project name is incorrectly blank and should 
  2579.  instead reflect the last project name. 
  2580.  Microsoft has confirmed this to be a problem with Microsoft Visual 
  2581.  Basic programming system version 1.0 for Windows. We are researching 
  2582.  this problem and will post new information here as it becomes 
  2583.  available. 
  2584.  More Information: 
  2585.  Steps to Reproduce Problem 
  2586.  -------------------------- 
  2587.  1. Start Visual Basic or choose New Project from the File menu. 
  2588.  2. From the File menu, choose Save Project As. Save the form with the 
  2589.     name Test1.FRM and the project with the name Test1.MAK. 
  2590.  3. From the Visual Basic File menu, choose Exit. 
  2591.  4. From the Windows Program Manager File menu, choose Run. Enter the 
  2592.     following path: 
  2593.        C:\VB\Test1.FRM 
  2594.  5. Visual Basic will start with an untitled Project Window that 
  2595.     contains the files Global.BAS and TEST1.FRM. 
  2596.  6. From the Visual Basic Run menu, choose Exit. Note that if you make 
  2597.     any changes to Test1.FRM and try to exit Visual Basic, the message 
  2598.     "Save changes to 'TEST1.FRM'?" will be displayed. If you choose Yes, 
  2599.     the changes to the form will be saved. If you choose to add another 
  2600.     form from the File menu with the New Form command, you will be asked 
  2601.     to to save the changes to each Form followed by the message "Save 
  2602.     changes to '?'" when you exit Visual Basic. This is a problem unless 
  2603.     you remember the Project name Test1.MAK. If you remember the filename, 
  2604.     then the message "Replace existing 'C:\VB\TEST1.MAK'?" will be 
  2605.     displayed and the new form or forms will be added to the project under 
  2606.     the old project name. 
  2607.  A workaround is to choose the Run command from the Windows Program 
  2608.  Manager File menu with the following Path: 
  2609.     C:\VB\Test1.MAK 
  2610.  Visual Basic should now start with the correctly titled Project Window 
  2611.  named TEST1.MAK. 
  2612. Title: Documentation Errors in First Printing of VB CDK Guide 
  2613. Document Number: Q74676           Publ Date:  2-AUG-1991 
  2614. Product Name: Microsoft Visual Basic 
  2615. Product Version:  1.00 
  2616. Operating System: WINDOWS 
  2617.  
  2618.  Summary: 
  2619.  Below is a list of documentation errors in the first printing of the 
  2620.  "Microsoft Visual Basic: Control Development Guide" shipped with the 
  2621.  Visual Basic Control Development Kit (CDK). 
  2622.  The documentation errors listed below may not apply to later printings 
  2623.  of the "Microsoft Visual Basic: Control Development Guide." 
  2624.  Many of the errors were corrected in the CDK Help file before 
  2625.  shipping. 
  2626.  The CDK is an add-on to the Microsoft Visual Basic programming system 
  2627.  version 1.0 for Windows. 
  2628.  More Information: 
  2629.  Corrections to the "Microsoft Visual Basic: Control Development Guide" 
  2630.  ---------------------------------------------------------------------- 
  2631.  (page 79) Middle of the page: 
  2632.     "...fourth field in the EVENTINFO structure..." should read 
  2633.     "...fourth field in the PROPINFO structure..." 
  2634.  Code at bottom of page: 
  2635.     "OFFSETIN(MYCTL, Language)," should read 
  2636.     "OFFSETIN(MYCTL, enumLanguage)," 
  2637.  (page 112) VBXPixelsToTwips, VBYPixelsToTwips: 
  2638.  Return data type is listed in Syntax as SHORT; it should be LONG. 
  2639.     "...in logical twips into a measurement in pixels..." should read 
  2640.     "...in logical pixels into a measurement in twips..." 
  2641.  In the chart, Type should list as SHORT. 
  2642.  (page 136) In the table, the incorrect heading "Flag Value" should be 
  2643.     changed to "Field Name". 
  2644. Title: Closed Split Window Incorrectly Allows Text Entry 
  2645. Document Number: Q74731           Publ Date:  2-AUG-1991 
  2646. Product Name: Microsoft Visual Basic 
  2647. Product Version:  1.00 
  2648. Operating System: WINDOWS 
  2649.  
  2650.  Summary: 
  2651.  You can cause Microsoft Visual Basic to set the input focus to an 
  2652.  invisible "view" of a split code window. Input is still accepted when 
  2653.  the focus is set to the invisible portion of the code window, but will 
  2654.  not be visible to the user. This is incorrect behavior, because 
  2655.  closing a split window should shift focus to the first window. 
  2656.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  2657.  programming system version 1.0 for Windows. We are researching this 
  2658.  problem and will post new information here as it becomes available. 
  2659.  More Information: 
  2660.  Note that the "splitter bar" (the horizontal border just above the 
  2661.  editing area and just above the vertical scroll bar) allows you to 
  2662.  split the code window into two parts, which allows you to view two 
  2663.  different sections of code at once. 
  2664.  Steps to Reproduce Problem 
  2665.  -------------------------- 
  2666.  1. Start Visual Basic or choose New Project from Visual Basic's 
  2667.     File menu. 
  2668.  2. Double-click on Form1 to bring up a code window. 
  2669.  3. Drag down the code window splitter bar to the middle of the code 
  2670.     window, splitting the code window into two views. 
  2671.  4. Click in the upper view of the code window to place the text 
  2672.     insertion point there. 
  2673.  5. Select the code window splitter bar and drag it upwards to close 
  2674.     the upper view in the code window. 
  2675.  6. Type "Sub foo" (without the quotation marks) and press ENTER. No 
  2676.     text will appear in the code window, because the focus is set to the 
  2677.     invisible half of the window. However, the contents of the "Proc" 
  2678.     drop-down combo box will change to "Foo," indicating that Sub Foo has 
  2679.     been created. 
  2680.  7. Click on the code window splitter bar again and pull the splitter 
  2681.     bar back to the center of the code window. The text insertion point 
  2682.     will appear in the upper view of the code window, and the current 
  2683.     procedure for the upper view will be Sub Foo. 
  2684. Title: Example of Client/Server DDE Between Visual Basic Applications 
  2685. Document Number: Q74861           Publ Date:  2-AUG-1991 
  2686. Product Name: Microsoft Visual Basic 
  2687. Product Version:  1.00 
  2688. Operating System: WINDOWS 
  2689.  
  2690.  Summary: 
  2691.  This article outlines the steps necessary to initiate dynamic data 
  2692.  exchange (DDE) between a Microsoft Visual Basic client application and 
  2693.  a Visual Basic server application. 
  2694.  This article demonstrates how to: 
  2695.  1. Create a Visual Basic application to function as a server. 
  2696.  2. Create a Visual Basic application to function as a client. 
  2697.  3. Initiate a cold DDE link (information updated upon request from the 
  2698.     client) between the client application and the server application. 
  2699.  4. Use LinkRequest to update information in the client application 
  2700.     from information in the server application. 
  2701.  5. Initiate a hot DDE link (information updated automatically from 
  2702.     server to client) between the client application and the server 
  2703.     application. 
  2704.  6. Use LinkPoke to send information from the client application to the 
  2705.     server application. 
  2706.  7. Change the LinkMode property between hot and cold. 
  2707.  This information applies to Microsoft Visual Basic programming system 
  2708.  version 1.0 for Microsoft Windows. 
  2709.  More Information: 
  2710.  A client application sends commands through DDE to the server 
  2711.  application to establish a link. Through DDE, the server provides data 
  2712.  to the client at the request of the client or accepts information at 
  2713.  the request of the client. 
  2714.  Example 
  2715.  ------- 
  2716.  The steps below are an example of how to establish a DDE conversation 
  2717.  between two Visual Basic applications. 
  2718.  First, create the server application in Visual Basic: 
  2719.  1. Start Visual Basic, and Form1 will be created by default. 
  2720.  2. Change the Caption property of Form1 to "Server". 
  2721.  3. Put a Text Box (Text1) on Form1. 
  2722.  4. Save the form and project with the name SERVER. 
  2723.  5. From the File menu, choose Make EXE File. In the Make EXE File 
  2724.     dialog box, choose OK to accept SERVER.EXE as the name of the EXE 
  2725.     file. 
  2726.  Second, create the client application in Visual Basic: 
  2727.  1. From the File menu, choose New Project. Form1 will be created by 
  2728.     default. 
  2729.  2. Change the Caption property of Form1 to "Client". 
  2730.  3. Create the following controls with the following properties on 
  2731.     Form1: 
  2732.       Default Name    Caption           CtlName 
  2733.       ------------    -------           ------- 
  2734.       Text1           (Not applicable)  Text1 
  2735.       Option1         Cold Link         ColdLink 
  2736.       Option2         Hot Link          HotLink 
  2737.       Command1        Poke              Poke 
  2738.       Command2        Request           Request 
  2739.  4. Add the following code to the General Declaration section of Form1: 
  2740.        Const TRUE = -1 
  2741.        Const FALSE = 0 
  2742.        Const HOT = 1 
  2743.        Const COLD = 2 
  2744.        Const NONE = 0 
  2745.  5. Add the following code to the Load event procedure of Form1: 
  2746.  Sub Form_Load () 
  2747.      'This procedure will start the VB server application that was 
  2748.      'created earlier 
  2749.      z% = Shell("C:\VB\SERVER", 1) 
  2750.      z% = DoEvents()                    'Causes Windows to finish 
  2751.                                         'processing the Shell command. 
  2752.      Text1.LinkMode = NONE       'Clears DDE link if it already exists. 
  2753.      Text1.LinkTopic = "Server]Form1"     'Sets up link with VB server. 
  2754.      Text1.LinkItem = "Text1"         'Set link to text box on server. 
  2755.      Text1.LinkMode = COLD            'Establish a cold DDE link. 
  2756.      ColdLink.Value = TRUE            'Sets appropriate option button. 
  2757.  End Sub 
  2758.  6. Add the following code to the Click event procedure of ColdLink: 
  2759.  Sub ColdLink_Click () 
  2760.      Request.Visible = TRUE     'Make request button valid. 
  2761.      Text1.LinkMode = NONE      'Clear DDE Link. 
  2762.      Text1.LinkMode = COLD      'Reestablish new LinkMode. 
  2763.  End Sub 
  2764.  7. Add the following code to the Clink event procedure of HotLink: 
  2765.  Sub HotLink_Click () 
  2766.      Request.Visible = FALSE    'No need for button with hot link. 
  2767.      Text1.LinkMode = NONE      'Clear DDE Link. 
  2768.      Text1.LinkMode = HOT       'Reestablish new LinkMode. 
  2769.  End Sub 
  2770.  8. Add the following code to the Click event procedure of Request: 
  2771.  Sub Request_Click () 
  2772.      'With a cold DDE link, this button will be visible, and when 
  2773.      'selected it will request an update of information from the server 
  2774.      'application to the client application. 
  2775.      Text1.LinkRequest 
  2776.  End Sub 
  2777.  9. Add the following code to the Click event procedure of Poke: 
  2778.  Sub Poke_Click () 
  2779.      'With any DDE link, this button will be visible, and when 
  2780.      'it selected, will poke information from the client application 
  2781.      'into the server application. 
  2782.      Text1.LinkPoke 
  2783.  End Sub 
  2784.  You can now run the Visual Basic client application from the VB.EXE 
  2785.  environment (skip to step 4 below) or you can save the application and 
  2786.  create an .EXE file and run that from Windows (continue to step 1 
  2787.  below). 
  2788.  1. From the File menu, choose Save and save the form and project with 
  2789.     the name CLIENT. 
  2790.  2. From the File menu, choose Make EXE File with the name CLIENT.EXE. 
  2791.  3. Exit the Visual Basic environment (VB.EXE). 
  2792.  4. Run the application (from Windows if an .EXE file, or from the Run 
  2793.     menu if from the VB.EXE environment.) 
  2794.  5. Form1 of the client application will load and the server 
  2795.     application will automatically start. 
  2796.  You can now experiment with DDE between Visual Basic applications: 
  2797.  1. Try typing some text into the server's text box and then click the 
  2798.     Update button. The text appears in the client's text box. 
  2799.  2. Click the Hot Link button and then type some more text into the 
  2800.     server's text box. The text is automatically updated in the 
  2801.     client's text box. 
  2802.  3. Type some text into the client's text box and click the Poke 
  2803.     button. The text is sent to the server's text box. 
  2804.  You can also establish DDE between applications at design time, as 
  2805.  described on page 356 of the "Microsoft Visual Basic: Programmer's 
  2806.  Guide" version 1.0 manual. 
  2807.  For additional information on dynamic data exchange (DDE) between 
  2808.  Visual Basic 1.0 and other Windows applications, query on the 
  2809.  following words: 
  2810.     DDE and Visual Basic 
  2811. Title: DDE Example Between Visual Basic and Word for Windows 
  2812. Document Number: Q74862           Publ Date:  2-AUG-1991 
  2813. Product Name: Microsoft Visual Basic 
  2814. Product Version:  1.00 
  2815. Operating System: WINDOWS 
  2816.  
  2817.  Summary: 
  2818.  This article outlines the steps necessary to initiate dynamic data 
  2819.  exchange (DDE) between a Microsoft Visual Basic application and a 
  2820.  Microsoft Word for Windows (WINWORD.EXE) document at run time. 
  2821.  This article demonstrates how to: 
  2822.  1. Prepare a Word for Windows document for active DDE. 
  2823.  2. Initiate a cold DDE link (information updated upon request from 
  2824.     the client) between the Visual Basic application (the client) and 
  2825.     the document loaded into Word for Windows (the server). 
  2826.  3. Use LinkRequest to update information in the Visual Basic client 
  2827.     based on information contained in the Word for Windows server. 
  2828.  4. Initiate a hot DDE link (information updated automatically from 
  2829.     server to client) between the Visual Basic client and the Word for 
  2830.     Windows server. 
  2831.  5. Use LinkPoke to send information from the Visual Basic client to 
  2832.     the Word for Windows server. 
  2833.  6. Change the LinkMode property between hot and cold. 
  2834.  This information applies to Microsoft Visual Basic programming system 
  2835.  version 1.0 for Microsoft Windows. 
  2836.  More Information: 
  2837.  A client application sends commands through DDE to the server 
  2838.  application to establish a link. Through DDE, the server provides data 
  2839.  to the client at the request of the client or accepts information at 
  2840.  the request of the client. 
  2841.  Example 
  2842.  ------- 
  2843.  The steps below are an example of how to establish a DDE conversation 
  2844.  between a Visual Basic application and a document loaded into Word for 
  2845.  Windows (WINWORD.EXE). 
  2846.  First, create the server document in Word for Windows: 
  2847.  1. Start Word for Windows. "Document1" will be created by default. 
  2848.  2. From the Window menu, choose Arrange All. This unmaximizes the 
  2849.     document if it was maximized. Note that the title at the top of the 
  2850.     WINWORD.EXE main title bar is now "Microsoft Word" and NOT 
  2851.     "Microsoft Word - Document1". 
  2852.  3. Press SHIFT+END to select the document. 
  2853.  4. From the Insert menu, choose Bookmark. Under Bookmark Name, type 
  2854.     "DDE_Link" (without quotation marks). Press ENTER. This sets a 
  2855.     bookmark for the entire document. This bookmark will function as 
  2856.     the LinkItem in the DDE conversation. 
  2857.  5. From the File menu, choose Save As, and save the document with the 
  2858.     name SERVER.DOC. 
  2859.  6. Exit Word for Windows. For this particular example to function 
  2860.     properly, WINWORD.EXE must not be loaded and running. 
  2861.  Second, create the client application in Visual Basic: 
  2862.  1. Start Visual Basic. Form1 will be created by default. 
  2863.  2. Create the following controls with the following properties on 
  2864.     Form1: 
  2865.     Default Name     Caption           CtlName 
  2866.     ------------     -------           ------- 
  2867.     Text1            (Not applicable)  Text1 
  2868.     Option1          Cold Link         ColdLink 
  2869.     Option2          Hot Link          HotLink 
  2870.     Command1         Poke              Poke 
  2871.     Command2         Request           Request 
  2872.  3. Add the following code to the General Declaration section of Form1: 
  2873.        Const TRUE = -1 
  2874.        Const FALSE = 0 
  2875.        Const HOT = 1 
  2876.        Const COLD = 2 
  2877.        Const NONE = 0 
  2878.  4. Add the following code to the Load event procedure of Form1: 
  2879.  Sub Form_Load () 
  2880.      'This procedure will start WINWORD.EXE, load the document that was 
  2881.      'created earlier and prepared for DDE by creating a bookmark to 
  2882.      'the whole document.  This bookmark is necessary because it 
  2883.      'functions as the LinkItem for the server in the DDE conversation. 
  2884.      z% = Shell("C:\WinWord\WinWord C:\WinWord\Server.Doc",1) 
  2885.      z% = DoEvents ()           'Process Windows events. This ensures 
  2886.                                 'that WinWord will be executed before 
  2887.                                 'any attempt is made to perform DDE 
  2888.                                 'with it. 
  2889.      Text1.LinkMode = NONE      'Clears DDE link if it already exists. 
  2890.      Text1.LinkTopic = "WinWord]\WinWord\Server"     'Sets up link with 
  2891.                                                      'WINWORD.EXE. 
  2892.      Text1.LinkItem = "DDE_Link"     'Set link to bookmark on document. 
  2893.      Text1.LinkMode = COLD           'Establish a cold DDE link. 
  2894.      ColdLink.Value = TRUE 
  2895.  End Sub 
  2896.  5. Add the following code to the Click event procedure of the Cold 
  2897.     Link button: 
  2898.  Sub ColdLink_Click () 
  2899.          Request.Visible = TRUE       'Make request button valid. 
  2900.          Text1.LinkMode = NONE        'Clear DDE Link. 
  2901.          Text1.LinkMode = COLD        'Reestablish new LinkMode. 
  2902.  End Sub 
  2903.  6. Add the following code to the Click event procedure of the Hot 
  2904.     Link button: 
  2905.  Sub HotLink_Click () 
  2906.          Request.Visible = FALSE     'No need for button with hot link. 
  2907.          Text1.LinkMode = NONE        'Clear DDE Link. 
  2908.          Text1.LinkMode = HOT         'Reestablish new LinkMode. 
  2909.  End Sub 
  2910.  7. Add the following code to the Click event procedure of the Request 
  2911.     button: 
  2912.  Sub Request_Click () 
  2913.      'With a cold DDE link this button will be visible, and clicking 
  2914.      'this button will request an update of information from the server 
  2915.      'application to the client application. 
  2916.      Text1.LinkRequest 
  2917.  End Sub 
  2918.  8. Add the following code to the Click event procedure of the Poke 
  2919.     button: 
  2920.  Sub Poke_Click () 
  2921.      'With any DDE link, this button will be visible, and clicking 
  2922.      'this button will poke information from the client application 
  2923.      'into the server application. 
  2924.      Text1.LinkPoke 
  2925.  End Sub 
  2926.  You can now run the Visual Basic client application from the Visual 
  2927.  Basic VB.EXE environment (skip to step 4 below) or you can save the 
  2928.  application and create an EXE file and run that from Windows (continue 
  2929.  to step 1 below). 
  2930.  1. From the File menu, choose Save and save the form and project with 
  2931.     the name CLIENT. 
  2932.  2. From the File menu, choose Make EXE File with the name CLIENT.EXE. 
  2933.  3. Exit the Visual Basic environment (VB.EXE). 
  2934.  4. Run the application (from Windows if an .EXE file or from the Run 
  2935.     menu if from the Visual Basic environment.) 
  2936.     Form1 of the Visual Basic client application will be loaded, and 
  2937.     Word for Windows will automatically be started with the document 
  2938.     SERVER.DOC loaded. 
  2939.  5. Make sure that the main title bar in WINWORD.EXE reads "Microsoft 
  2940.     Word", NOT "Microsoft Word - SERVER.DOC". If the title bar is not 
  2941.     correct, choose Arrange All from the Window menu. 
  2942.  You can now experiment with DDE between Visual Basic and Word 
  2943.  for Windows: 
  2944.  1. Try typing some text into the document in Word for Windows, and 
  2945.     then click the Request button. The text appears in the text box. 
  2946.  2. Click Hot Link and then type some more text into the document in 
  2947.     Word for Windows. The text is automatically updated in the Visual 
  2948.     Basic text box. 
  2949.  3. Type some text in the text box in the Visual Basic application and 
  2950.     click the Poke button. The text is sent to the document in Word for 
  2951.     Windows. 
  2952.  Note that if in the WINWORD.EXE document, you delete the total 
  2953.  contents of the bookmark, the bookmark will also be deleted. Any 
  2954.  further attempt to perform DDE with this WINWORD.EXE session after the 
  2955.  bookmark has been deleted gives the following error message: 
  2956.     Foreign application won't perform DDE method or operation. 
  2957.  If this happens, you must recreate the bookmark in the document in 
  2958.  Word for Windows before performing any further DDE operations. 
  2959.  You can also establish DDE between applications at design time, as 
  2960.  described on page 356 of the "Microsoft Visual Basic: Programmer's 
  2961.  Guide" version 1.0 manual. 
  2962.  For additional information on dynamic data exchange (DDE) between 
  2963.  Visual Basic 1.0 and other Windows applications, query on the 
  2964.  following words: 
  2965.      DDE and Visual Basic 
  2966. Title: Access Key Causes Different Event Order than Clicking 
  2967. Document Number: Q74905           Publ Date:  6-AUG-1991 
  2968. Product Name: Microsoft Visual Basic 
  2969. Product Version:  1.00 
  2970. Operating System: WINDOWS 
  2971.  
  2972.  Summary: 
  2973.  In Visual Basic, events may be generated in a different order if you 
  2974.  choose a control (such as a button, a check box, or an option box) 
  2975.  using an access key rather than with the mouse. The events that occur 
  2976.  in a different order are Click, LostFocus, and GotFocus. The differing 
  2977.  order of events is by design and is not the result of a problem with 
  2978.  Visual Basic. 
  2979.  This information applies to Microsoft Visual Basic programming system 
  2980.  version 1.0 for Windows. 
  2981.  More Information: 
  2982.  You can create an access key at design time by changing the 
  2983.  Caption property of a control to include an ampersand (&). The access 
  2984.  key is the character after the ampersand, and at run time you press 
  2985.  ALT+character to choose the control. (See page 120 of the "Microsoft 
  2986.  Visual Basic: Programmer's Guide" version 1.0. manual.) 
  2987.  When you press an access key (ALT+character) to choose a control, the 
  2988.  Click event is generated before the LostFocus and GotFocus event; 
  2989.  however, when you choose a control by clicking the mouse, the 
  2990.  LostFocus and GotFocus events are generated before the Click event. 
  2991.  The example below shows this different order of events. The example 
  2992.  uses command buttons, but also applies to Check and Option boxes: 
  2993.  1. Open a new form and create two command buttons. 
  2994.  2. Enter the code as shown further below. 
  2995.  3. Change the Caption property of Command2 to "Command&2" 
  2996.  4. Run the program. 
  2997.  5. a. When Command1 has the focus and you click on Command2, the 
  2998.        following events are generated in the following order: 
  2999.        Command1_LostFocus 
  3000.        Command2_GotFocus 
  3001.        Command2_Click 
  3002.     b. When Command1 has the focus and you press the access key, ALT+2, 
  3003.        the following events are generated in the following order: 
  3004.        Command2_Click 
  3005.        Command1_LostFocus 
  3006.        Command2_GetFocus 
  3007.  Sample Code: 
  3008.  ----------- 
  3009.  Sub Command1_Click () 
  3010.     Print "Command1_click" 
  3011.  End Sub 
  3012.  Sub Command1_LostFocus () 
  3013.     Print "Command1_lostfocus" 
  3014.  End Sub 
  3015.  Sub Command1_GotFocus () 
  3016.      Print "Command1_gotfocus" 
  3017.  End Sub 
  3018.  Sub Command2_Click () 
  3019.      Print "Command2_click" 
  3020.  End Sub 
  3021.  Sub Command2_LostFocus () 
  3022.     Print "Command2_lostfocus" 
  3023.  End Sub 
  3024.  Sub Command2_GotFocus () 
  3025.     Print "Command2_gotfocus" 
  3026.  End Sub 
  3027. Title: Carriage Return+Linefeed to Wrap Lines in Text Box Control 
  3028. Document Number: Q74906           Publ Date:  6-AUG-1991 
  3029. Product Name: Microsoft Visual Basic 
  3030. Product Version:  1.00 
  3031. Operating System: WINDOWS 
  3032.  
  3033.  Summary: 
  3034.  Using the carriage return character, Chr$(13), alone to create a line 
  3035.  wrap to the next line in a Visual Basic text box control will cause 
  3036.  the character following the carriage return to be removed from a 
  3037.  multiline text box. To correctly wrap to the next line, you must 
  3038.  instead use both a carriage return and a linefeed, Chr$(10). This 
  3039.  requirement is by design. 
  3040.  This information applies to Microsoft Visual Basic programming system 
  3041.  version 1.0 for Windows. 
  3042.  More Information: 
  3043.  The correct method to create a line wrap is to use a carriage return 
  3044.  character followed by a linefeed character, Chr$(13) + Chr$(10). The 
  3045.  Windows text box expects to find this sequence and assumes that the 
  3046.  character following the carriage return is a linefeed, thus removing 
  3047.  the following character as if it were a linefeed. 
  3048.  The following steps show the results of using just the carriage 
  3049.  return, and the results of using both carriage return and linefeed 
  3050.  characters in a text box. 
  3051.  1. In a new project, click on the text box icon from the Toolbox 
  3052.     (second tool down in the right column). 
  3053.  2. Click anywhere on the form and drag diagonally to create a text box 
  3054.     large enough to hold more then one line of text. 
  3055.  3. From the Properties bar (below the main menu) scroll down to 
  3056.     Multiline, then choose the Settings box for that Multiline property 
  3057.     (also on the Properties bar below the menu) and choose True. The 
  3058.     text box can now accommodate several lines of text. 
  3059.  4. Double-click anywhere in the form outside of the text box to bring 
  3060.     up the Form_click code window (or use the F7 function key). 
  3061.  5. On the line below Sub Form_click (), type the following: 
  3062.        Text1.text = "Hello" + Chr$(13) + "World" 
  3063.  6. Press F5 to run the newly created application, then click 
  3064.     anywhere in the form outside the text box. The following text 
  3065.     will appear: 
  3066.        Hello 
  3067.        orld 
  3068.     Note that the W of "World" is missing. 
  3069.  7. To obtain the desired result, you must add a linefeed following the 
  3070.     carriage return character, as follows: 
  3071.        Text1.text = "Hello" + Chr$(13) + Chr$ (10) + "World" 
  3072.     This will now display as expected: 
  3073.        Hello 
  3074.        World 
  3075. Title: How VB Can Determine if a Specific Windows Program Is Running 
  3076. Document Number: Q72918           Publ Date: 13-AUG-1991 
  3077. Product Name: Microsoft Visual Basic 
  3078. Product Version:  1.00 
  3079. Operating System: WINDOWS 
  3080.  
  3081.  Summary: 
  3082.  To determine if a specific program is running, call the Windows API 
  3083.  function FindWindow. FindWindow returns the handle of the window whose 
  3084.  class is given by the "lpClassname" parameter and whose window name, 
  3085.  or caption, is given by the "lpCaption" parameter. If the returned 
  3086.  value is zero, then the application is not running. 
  3087.  This information applies to Microsoft Visual Basic Programming System 
  3088.  version 1.0 for Windows. 
  3089.  More Information: 
  3090.  By calling FindWindow with a combination of a specific program's class 
  3091.  name and/or the title-bar caption, your program can determine whether 
  3092.  that specific program is running. 
  3093.  When an application is started from the Program Manager, it registers 
  3094.  the class name of the form. The window class provides information 
  3095.  about the name, attributes, and resources required by your form. All 
  3096.  Visual Basic forms have a class name of "ThunderForm". You can 
  3097.  determine the class name of an application by using SPY.EXE that comes 
  3098.  with the Microsoft Windows 3.0 Software Development Kit (SDK). 
  3099.  If the window has a caption bar title, you can also use the title to 
  3100.  locate the instance of the running application. This caption text is 
  3101.  valid even when the application is minimized to an icon. 
  3102.  Because another instance of your Visual Basic program will have the same 
  3103.  class name and may have the same title bar caption, you must use 
  3104.  Dynamic Data Exchange (DDE) to determine if another instance of your 
  3105.  Visual Basic program is running. (This DDE technique is not shown in 
  3106.  this article). 
  3107.  The following example shows three ways to determine if the Windows 3.0 
  3108.  Calculator is running. To create the program, do the following: 
  3109.  1. Create a form. 
  3110.  2. Declare the Windows 3.0 API function FindWindow in the Global- 
  3111.     Declarations section of the code window. The variables are declared 
  3112.     as "Any" because you can pass either a pointer to a string, or a NULL 
  3113.     value. You as a programmer are responsible for passing the correct 
  3114.     variable type. Note that the Declare statement should be entered on 
  3115.     just one line: 
  3116.     Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any, 
  3117.                                              ByVal lpCaption As Any) 
  3118.  3. Add the following code to the form's Click event. This example 
  3119.     demonstrates how you can find the instance of the application with a 
  3120.     combination of the class name and/or the window's caption. In this 
  3121.     example, the application will find an instance of the Windows 3.0 
  3122.     calculator (CALC.EXE). 
  3123.  Sub Form_Click () 
  3124.     Const NULL = 0& 
  3125.     lpClassName$ = "SciCalc" 
  3126.     lpCaption$ = "Calculator" 
  3127.     Print "Handle = ";FindWindow(lpClassName$, NULL) 
  3128.     Print "Handle = ":FindWindow(NULL, lpCaption$) 
  3129.     Print "Handle = ";FindWindow(lpClassName$,lpCaption$) 
  3130.  End Sub 
  3131.  4. Run this program with CALC.EXE running and without CALC.EXE 
  3132.     running. If CALC.EXE is running, your application will print an 
  3133.     arbitrary handle. If CALC.EXE is not running, your application will 
  3134.     print the number zero as a handle. 
  3135.  Below are some class names of applications that are shipped with 
  3136.  Windows 3.0: 
  3137.  Class Name         Application 
  3138.  -----------        ----------- 
  3139.  SciCalc            CALC.EXE 
  3140.  CalWndMain         CALENDAR.EXE 
  3141.  Cardfile           CARDFILE.EXE 
  3142.  Clipboard          CLIPBOARD.EXE 
  3143.  Clock              CLOCK.EXE 
  3144.  CtlPanelClass      CONTROL.EXE 
  3145.  Session            MS-DOS.EXE 
  3146.  Notepad            NOTE.EXE 
  3147.  pbParent           PBRUSH.EXE 
  3148.  Pif                PIFEDIT.EXE 
  3149.  PrintManager       PRINTMAN.EXE 
  3150.  Recorder           RECORDER.EXE 
  3151.  Reversi            REVERSI.EXE 
  3152.  #32770             SETUP.EXE 
  3153.  Solitaire          SOL.EXE 
  3154.  Terminal           TERMINAL.EXE 
  3155.  WFS_Frame          WINFILE.EXE 
  3156.  MW_WINHELP         WINHELP.EXE 
  3157.  #32770             WINVER.EXE 
  3158.  MSWRITE_MENU       WRITE.EXE 
  3159.  Reference(s): 
  3160.  "Peter Norton's Windows 3.0 Power Programming Techniques," by Peter 
  3161.  Norton and Paul Yao (published by Bantam Computer Books, 1990). 
  3162. Title: Option Button with Access Key Gives UAE if Unload Is Invoked 
  3163. Document Number: Q74982           Publ Date: 13-AUG-1991 
  3164. Product Name: Microsoft Visual Basic 
  3165. Product Version:  1.00 
  3166. Operating System: WINDOWS 
  3167.  
  3168.  Summary: 
  3169.  If an option button containing an Unload statement in its Click event 
  3170.  procedure is selected using the keyboard (an access key, the cursor 
  3171.  keys, or the TAB key), the application terminates with a Windows 
  3172.  Unrecoverable Application Error (UAE). Using the mouse to select 
  3173.  the option button causes the Unload statement to execute correctly and 
  3174.  does not generate a UAE. 
  3175.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  3176.  programming system version 1.0 for Windows. We are researching this 
  3177.  problem and will post new information here as it becomes available. 
  3178.  More Information: 
  3179.  Steps to Reproduce Problem 
  3180.  -------------------------- 
  3181.  1. Run Visual Basic or choose New Project from the File menu (ALT, F, 
  3182.     N). Form1 will be created by default. 
  3183.  2. Place any control on Form1. 
  3184.  3. Place an option button (Option1) on Form1. 
  3185.  4. Assign an access key to Option1 by entering "&UAE" (without the 
  3186.     quotation marks) for the Caption property of Option1. This will 
  3187.     cause the letter U to become the access key for Option1. 
  3188.  5. Add the following code to the Option1_Click event procedure: 
  3189.        Sub Option1_Click () 
  3190.        Unload Form1 
  3191.        End Sub 
  3192.  6. Run the program (F5). 
  3193.  7. Use the access key (ALT+U), the cursor keys, or the TAB key to 
  3194.     select the option button. When the option button is selected in 
  3195.     this manner, a UAE will be generated. 
  3196.  When you select the option button with the mouse, no UAE will occur. 
  3197.  The UAE only occurs when the Click event is caused from the keyboard. 
  3198. Title: "Visual Basic 1.0 Setup by Batch File" Appnote Available 
  3199. Document Number: Q75370           Publ Date: 20-AUG-1991 
  3200. Product Name: Microsoft Visual Basic 
  3201. Product Version:  1.00 
  3202. Operating System: WINDOWS 
  3203.  
  3204.  Summary: 
  3205.  In rare cases, certain hardware configurations may not work properly 
  3206.  with the SETUP.EXE utility shipped with Microsoft Visual Basic 
  3207.  programming system version 1.0 for Windows. 
  3208.  As an alternative installation method for Visual Basic 1.0, you can 
  3209.  use the application note titled "Visual Basic 1.0 Setup by Batch File" 
  3210.  (BV0446). To obtain application notes, call Microsoft Product Support 
  3211.  Services at (206) 454-2030. Please specify whether you want a 3.5-inch 
  3212.  (720K) or 5.25-inch (1.2 MB) disk (no other disk format is available). 
  3213.  More Information: 
  3214.  Microsoft can only distribute this application note to registered 
  3215.  owners of Visual Basic because it contains uncompressed copies of 
  3216.  Visual Basic's Icon Library files. Thus, this application note is not 
  3217.  available on online electronic services; it is only available directly 
  3218.  from Microsoft. 
  3219.  This application note includes the following files and subdirectories 
  3220.  on disk: 
  3221.  README.NOW   VBSETUP.BAT  VBSETUP1.BAT  DECOMP.EXE 
  3222.  VBSETUP.BAT must be run from DOS and from the drive in which you 
  3223.  inserted the disk. For example, typing the following from the drive C 
  3224.  DOS prompt won't work: 
  3225.     a:vbsetup 
  3226.  Instead, you must make drive A (or the drive in which you inserted the 
  3227.  disk) the active drive before running VBSETUP.BAT. For example, type 
  3228.  "A:" (without the quotation marks) at the drive C DOS prompt and then 
  3229.  type "VBSETUP" at the drive A DOS prompt. 
  3230.  Note: When you run VBSETUP as shown above (with no arguments), further 
  3231.  usage instructions will be displayed on the screen. 
  3232.  The Icon Library shipped with Visual Basic is contained on the 
  3233.  enclosed disk in uncompressed format, and will be copied to your 
  3234.  destination directory by VBSETUP. This disk (and the included Icon 
  3235.  Library) may only be distributed to registered owners of Microsoft 
  3236.  Visual Basic. VBSETUP.BAT will only work with 5.25-inch 1.2 MB disks, 
  3237.  or with 3.5-inch 720K disks. VBSETUP.BAT will not work with 5.25-inch 
  3238.  360K disks. 
  3239. Title: Determining Whether TAB or Mouse Gave a VB Control the Focus 
  3240. Document Number: Q75411           Publ Date: 20-AUG-1991 
  3241. Product Name: Microsoft Visual Basic 
  3242. Product Version:  1.00 
  3243. Operating System: WINDOWS 
  3244.  
  3245.  Summary: 
  3246.  You can determine whether a Visual Basic control received the focus 
  3247.  from a mouse click or a TAB keystroke by calling the Windows API 
  3248.  function GetKeyState in the control's GotFocus event procedure. By 
  3249.  using GetKeyState to check if the TAB key is down, you can determine 
  3250.  if the user tabbed to the control; if the TAB key was not used (and 
  3251.  the control does not have an access key), the user must have clicked 
  3252.  on the control with the mouse to set the focus. 
  3253.  This information applies to Microsoft Visual Basic programming system 
  3254.  version 1.0 for Windows. 
  3255.  More Information: 
  3256.  The GetKeyState Windows API function takes an integer parameter 
  3257.  containing the virtual key code for the desired key states. 
  3258.  GetKeyState returns an integer. If the return value is negative, the 
  3259.  key has been pressed. 
  3260.  The following is a code example. To use this example, start with a new 
  3261.  project in Visual Basic. Add a text box and a command button to Form1. 
  3262.  Enter the following code in the project's GLOBAL.BAS module: 
  3263.  'Global Module 
  3264.  Declare Function GetKeyState% Lib "User" (ByVal nVirtKey%) 
  3265.  Global Const VK_TAB = 9 
  3266.  Add the following code to the GotFocus event procedure for the Text1 
  3267.  text box control: 
  3268.  Sub Text1_GotFocus() 
  3269.    If GetKeyState(VK_TAB) < 0 Then 
  3270.      Text1.SelStart = 0 
  3271.      Text1.SelLength = Len(Text1.Text) 
  3272.    Else 
  3273.      Text1.SelLength = 0 
  3274.    End If 
  3275.  End Sub 
  3276.  Run the program. If you use the TAB key to move the focus from the 
  3277.  command button to the text box, you should see the text in the text 
  3278.  box selected. If you change the focus to the text box by clicking on 
  3279.  it with the mouse, the text will not be selected. 
  3280.  If the control has an access key (assigned by using an ampersand [&| 
  3281.  in the control's caption property), then you may also want to check 
  3282.  the state of the virtual ALT key using GetKeyState to see if the user 
  3283.  changed the focus using the access key. The virtual key code for ALT, 
  3284.  actually known as VK_MENU, is 12. 
  3285. Title: Setup "Illegal Function Call" if Manually Delete Existing File 
  3286. Document Number: Q75412           Publ Date: 20-AUG-1991 
  3287. Product Name: Microsoft Visual Basic 
  3288. Product Version:  1.00 
  3289. Operating System: WINDOWS 
  3290.  
  3291.  Summary: 
  3292.  If the Microsoft Visual Basic Setup program detects an existing copy 
  3293.  of Visual Basic already on the disk during installation, Setup will 
  3294.  ask whether or not you want to "Overwrite existing files?". At this 
  3295.  point, if you manually delete the existing files using a separate 
  3296.  process in Windows and then attempt to continue with the Setup, Setup 
  3297.  will give an "Illegal function call" error message and end without 
  3298.  installing Visual Basic. 
  3299.  Microsoft has confirmed this to be a problem with the Microsoft Visual 
  3300.  Basic programming system version 1.0 for Windows. We are researching 
  3301.  this problem and will post new information here as it becomes 
  3302.  available. 
  3303.  To work around the problem, let Setup overwrite the existing files. 
  3304.  More Information: 
  3305.  Steps to Reproduce Problem 
  3306.  -------------------------- 
  3307.  1. Have an installation of Visual Basic in the \VB subdirectory of 
  3308.     your hard disk. 
  3309.  2. Run the Visual Basic SETUP.EXE program. 
  3310.  3. When the subdirectory path to install Visual Basic is displayed, 
  3311.     make sure it points to the VB subdirectory where the files already 
  3312.     exist. Click on Continue. 
  3313.  4. Do not reply to the following message: 
  3314.        "A previous installation of Visual Basic has been found in this 
  3315.        directory. Overwrite existing files?" 
  3316.  5. Go to the File Manager in Windows and delete the existing Visual 
  3317.     Basic files. 
  3318.  6. Return to the Visual Basic Setup and click Yes in reply to the 
  3319.     message. 
  3320.  When you reply OK to the "Illegal function call" message that appears, 
  3321.  Setup ends without installing Visual Basic. To work around this 
  3322.  behavior when Visual Basic files already exist prior to installation, 
  3323.  either delete those files before starting Setup or let Setup overwrite 
  3324.  the existing files. 
  3325. Title: Corrections for Errors in Visual Basic Version 1.0 Manuals 
  3326. Document Number: Q73655           Publ Date: 21-AUG-1991 
  3327. Product Name: Microsoft Visual Basic 
  3328. Product Version:  1.00 
  3329. Operating System: WINDOWS 
  3330.  
  3331.  Summary: 
  3332.  Below are corrections for documentation errors in the manuals shipped 
  3333.  with Microsoft Visual Basic version 1.0 for Windows. 
  3334.  This master list of corrections includes and adds to the correction 
  3335.  list found in sections 2 and 3 of the README.TXT file shipped with 
  3336.  Visual Basic 1.0. Please use the article below as your master list for 
  3337.  making corrections to the Visual Basic manuals. 
  3338.  More Information: 
  3339.  Microsoft Visual Basic includes the following two manuals: 
  3340.   - "Microsoft Visual Basic: Programmer's Guide" 
  3341.   - "Microsoft Visual Basic: Language Reference" 
  3342.  In both manuals, all references to OS/2 and Presentation Manager (PM) 
  3343.  are misprints, and should be ignored. 
  3344.  Corrections to the "Microsoft Visual Basic: Programmer's Guide" 
  3345.  --------------------------------------------------------------- 
  3346.  (page 61) "To set the Caption property:" #2, last line: 
  3347.     "...you can skip Step 4 and proceed to Step 5." should read 
  3348.     "...you can skip Step 3 and proceed to Step 4." 
  3349.  (page 97) First line: 
  3350.     "...calls to the LogB procedure..." should read 
  3351.     "...calls to the LogF procedure..." 
  3352.  (page 106) Code at bottom of page should read: 
  3353.     x = Shell("\winword\winword.exe c:\winword\plan.doc", 1) 
  3354.      and 
  3355.     y = Shell("\winproj\winproj.exe c:\winproj\schedule.wpr", 1) 
  3356.  (page 117) Table at bottom of page, last two lines should be: 
  3357.     Caption         CtlName           Indented        Index 
  3358.     -               SepBar              Once 
  3359.                     AppName             Once            0 
  3360.     (Note that the README.TXT file incorrectly says to use 1 as 
  3361.     the index value for AppName above; 0 is the correct value.) 
  3362.  The following text should read: 
  3363.     "Turn off the Visible property for AppName by toggling the 
  3364.     Visible check box. The SepBar control has its caption set to a 
  3365.     hyphen (-), which causes Visual Basic to display a separator 
  3366.     bar." 
  3367.  (page 118) Second paragraph, delete the following: 
  3368.     "Therefore, you cannot delete the...of Appname." 
  3369.  Add the following line of code just above the End Sub for the 
  3370.  AddApp_Click procedure: 
  3371.     AppName(LMenu).Visible = -1 
  3372.  (page 129) Last paragraph, first line: 
  3373.     "...tabbing to the button and..." should read 
  3374.     "...tabbing to the option button group, using the arrow keys, 
  3375.     and..." 
  3376.  (page 146) Top: 
  3377.     "MsgBox msg$[,type%[,type%[,title$||"  should read 
  3378.     "MsgBox msg$[,type%[,title$||" 
  3379.  (page 153) Lines 8 through 14: 
  3380.     All references to CurrentX should be CurrentY and vice versa. 
  3381.  (page 170) Code at bottom of page: 
  3382.     Text1(I).Text = "Text1(" + Format(I) + ")"  should read 
  3383.     Text1(I).Text = "Text1(" + Format$(I) + ")" 
  3384.  (page 182) Code at top of page: 
  3385.     [object.|Line[(x1, y1)| - [x2, y2) [, color| should read 
  3386.     [object.|Line[(x1, y1)| - (x2, y2) [, color| 
  3387.  (page 204) Last paragraph, second line: 
  3388.     "...continuous line when mouse button..." should read 
  3389.     "...continuous line when the left mouse button..." 
  3390.  (page 223) Last paragraph, second line: 
  3391.     "...(named GroupChoice)..." should read 
  3392.     "...(named GroupList)..." 
  3393.  (page 106) Code at bottom of page should read: 
  3394.  (page 248) All references to the property DrawColor should be 
  3395.             omitted. There is no DrawColor property. 
  3396.  (page 261) First paragraph, second line: 
  3397.     "...variable-length strings." should read 
  3398.     "...fixed-length strings." 
  3399.  (page 267) Code at bottom of page: 
  3400.     All references to "Picture1.Picture" should read 
  3401.     "Form1.Picture1.Picture" 
  3402.  (page 270) Code at bottom of page third line from bottom: 
  3403.     "...Mid$(MyTime, 1, 2)..." should read 
  3404.     "...Mid$(MyTime, ((Hours-12)<10)+2, 2)..." 
  3405.  (page 276) Third paragraph, second line: 
  3406.     "KeyPress event ....The same thing happens when..." should read 
  3407.     "KeyDown event ...The KeyDown event gets the same code when..." 
  3408.  (page 288) last line: 
  3409.     "MB_EXCLAIM" should read 
  3410.     "MB_ICONEXCLAMATION" 
  3411.  (page 308) Third paragraph of code, second nested IF THEN statement: 
  3412.     "If FileListBox.List(ind) = ..." should read 
  3413.     "If FileListBox.List(Ind%) = ..." 
  3414.  (page 311) The code under "FileListBox_DblClick" 
  3415.     "FileListBox.Pattern = *.*" should read 
  3416.     "FileListBox.Pattern = "*.*" " 
  3417.  (page 313) Do Loop should read: 
  3418.     Do Until Instr(LastOne% + 1, Test$, "\") = 0 
  3419.        LastOne% = Instr(LastOne% + 1, Test$, "\") 
  3420.     Loop 
  3421.  (page 320) Last paragraph, last sentence should read: 
  3422.     "The maximum length of a file that can be edited with Text 
  3423.     Editor is a little less than 32,000 bytes, because that is 
  3424.     the default maximum number of characters you can assign to a 
  3425.     Visual Basic multiline text box control." 
  3426.  (page 330) Code sample seventh to last line and (page 331) second line: 
  3427.     "EndLine$ = Input$(1, 1)" should read 
  3428.     "EndLine$ = Input$(1, FileNum)" 
  3429.  (page 339) The Form_Load procedure: 
  3430.     Running this code will result in an error: "Illegal Function 
  3431.     call" on the statement "FieldBoxes(0).SetFocus" on the 
  3432.     second-to-last line. This is because the Form is not yet 
  3433.     visible. To solve the problem, add the following line of code 
  3434.     to the top of the procedure: Form1.Show 
  3435.  (page 339) Code under "Form_Load": 
  3436.     Add the following as first line after "Sub Form_Load": 
  3437.     "Form1.Show" 
  3438.  (page 339) Code at bottom of page: 
  3439.     "WorkingFileNum = FileOpener..." should read 
  3440.     "WorkingFileNum% = FileOpener..." 
  3441.  (page 341) All reference to FieldBoxes in the code example on Page 
  3442.             341 should specify the form. For example: Form1.FieldBoxes 
  3443.  (page 360) Note at bottom of page: 
  3444.     References to the ALT key should be ESC key. 
  3445.  (page 364) The Link Execute Event, second argument, last line of 
  3446.             description: 
  3447.     "...the client receives a negative argument." should read 
  3448.     "...the client receives a negative acknowledgment." 
  3449.  (page 369) Program example: 
  3450.     "if Err = DDE_NO_APP"  missing THEN statement. 
  3451.  (page 370) "Requesting Data from Other Applications" 
  3452.     All references to "warm link" should be references to "cold 
  3453.     link". 
  3454.  (page 371) "Notifying Other Applications..." first paragraph: 
  3455.     "(in the case of a warm link)" should read 
  3456.     "(in the case of a cold link)". 
  3457.  (page 378) "To load a custom control file:" 
  3458.     Delete step 2 (the second line). 
  3459.     "Type or select the name..." should be step 2. 
  3460.  (page 380) Under "Special Considerations When Declaring DLL Routines": 
  3461.     The statement "The Visual Basic package contains a file that 
  3462.     includes the declarations for all useful routines in the 
  3463.     operation ..." is incorrect. This file is not included with 
  3464.     Visual Basic, but is part of the add-on kit, "Microsoft 
  3465.     Windows Programmer's Reference" Book and Online Resource, 
  3466.     available from Microsoft at a charge. 
  3467.  (page 386) Code at top of page: 
  3468.     The first set of quotation marks around "Microsoft Excel" 
  3469.     should be straight quotation marks. 
  3470.  Add the following paragraph after first code fragment: 
  3471.     "The use of ByVal when passing a string is necessary because 
  3472.     the data type of that argument was declared As Any. 
  3473.     Including ByVal when passing a string declaring AsAny causes 
  3474.     Visual Basic to convert the string to the null-terminated 
  3475.     form expected by most DLL routines." 
  3476.     The following code at the bottom of the page: 
  3477.     "...Lib "User"..." should read 
  3478.     "...Lib "GDI"..." 
  3479.  (Index) A, "ALT key": 
  3480.     Delete "interrupting DDE 360" 
  3481.     A, "As Any": 
  3482.     Add to page list: "386" 
  3483.     E, after "Errors": 
  3484.     Add new topic: "ESC Key, interrupting DDE 360" 
  3485.     I, "Index property": 
  3486.     Add to page list on "creating control arrays": "117" 
  3487.     M, "Microsoft Visual Basic": 
  3488.     Change page list on "starting programs" from "17-18" to "16-17" 
  3489.     S, "Strings": 
  3490.     "variable-length 251, 385" should read 
  3491.     "use of ByVal with variable-length 251, 385, 386" 
  3492.  Corrections to "Microsoft Visual Basic: Language Reference" 
  3493.  ----------------------------------------------------------- 
  3494.  (page 9) Windows category: 
  3495.     "hWin" should read 
  3496.     "hWnd" 
  3497.  (page 27) Add to the Note the following paragraph: 
  3498.     "When you minimize a form whose AutoRedraw Property is set to 
  3499.     False (0), ScaleHeight and ScaleWidth are set to icon size. 
  3500.     When AutoRedraw is set to True (-1), ScaleHeight and 
  3501.     ScaleWidth remain the size of the restored window." 
  3502.  (page 31) Description: 
  3503.     "...for an object; for forms and picture boxes..." should read 
  3504.     "...for an object, for forms and text boxes..." 
  3505.  Add the following paragraph at the end of the Remarks section: 
  3506.     "Because of appearance, the BorderStyle for forms with a menu 
  3507.     can only be set to Sizeable (2) or Fixed Single (1). Setting 
  3508.     the BorderStyle property to None (0) or Fixed Double (3) 
  3509.     forces the BorderStyle property to Fixed Single (1)." 
  3510.  (page 52) Graphic image: 
  3511.     The image shown is an example of a check box; it should show 
  3512.     a combo box example. 
  3513.  (page 147) Description: 
  3514.     "read-only" should read 
  3515.     "read-write" 
  3516.  Change the Note to read as follows: 
  3517.     "For a form icon to be functional, the BorderStyle property 
  3518.     must be set to either 1 (Fixed Single) or 2 (Sizeable). The 
  3519.     MinButton property must be set to True (-1)." 
  3520.     "At runtime, you can assign an object's Icon property to 
  3521.     another object's DragIcon or Icon property. You can also 
  3522.     assign an icon returned by the LoadPicture function. Doing 
  3523.     this assigns an empty (null) icon, which enables you to draw 
  3524.     on the icon at run time." 
  3525.  (page 154) Despite references on page 154 and in the VB.EXE 
  3526.             online Help, the INPUT$ function is not supported 
  3527.             for files opened with random access. Attempting to 
  3528.             use INPUT$ on a file opened for random access results 
  3529.             in a "Bad file mode" error message. (Use of INPUT$ on 
  3530.             random files was eliminated in Visual Basic, as was 
  3531.             the older Basic statement FIELD.) 
  3532.  (page 184) In the second line of the Note: 
  3533.     "...by pressing the ALT key." should read 
  3534.     "...by pressing the ESC key." 
  3535.  (page 188) Last line of description should read: 
  3536.     "The List property is not available at design time; it is 
  3537.     read-only for drive, file, and directory list boxes and 
  3538.     read-write for combo and list boxes." 
  3539.  (page 209) Month Function: 
  3540.     In the Case statements, delete all numbers greater than 12. 
  3541.  (page 244) Pointer Property: 
  3542.     This property does not exist. The name was changed to 
  3543.     MousePointer Property (page 214). 
  3544.  (page 285) Syntax: 
  3545.     The syntax fo ClipBoard.SetData should be changed from 
  3546.     "ClipBoard.SetData (data%, [format%|) to 
  3547.     "Clipboard.SetData data%, [format%|" 
  3548. Title: Correction to WINAPI.TXT for Visual Basic Add-on Kit 
  3549. Document Number: Q74526           Publ Date: 21-AUG-1991 
  3550. Product Name: Microsoft Visual Basic 
  3551. Product Version:  1.00 
  3552. Operating System: WINDOWS 
  3553.  
  3554.  Summary: 
  3555.  The following corrections apply to the WINAPI.TXT file provided on 
  3556.  disk with the "Microsoft Windows Programmer's Reference" book and 
  3557.  Online Resource, add-on kit number 1-55615-413-5, for Microsoft Visual 
  3558.  Basic. 
  3559.  This information applies to Microsoft Visual Basic programming system 
  3560.  version 1.0 for Windows. 
  3561.  More Information: 
  3562.  The following corrections apply to the WINAPI.TXT file dated 5/14/91. 
  3563.  1. The following statement is incorrect 
  3564.        Declare Function SetCommState Lib "User" () 
  3565.     and should be changed to read as follows: 
  3566.        Declare Function SetCommState Lib "User" (lpDCB as DCB) As Integer 
  3567.  2. The Declare statement for WinExec is missing the ByVal attribute in 
  3568.     the second parameter. Without this ByVal, invoking WinExec can cause 
  3569.     a Windows "Unrecoverable Application Error" ("UAE"). The WinExec 
  3570.     Declare statement should be changed to read as follows (on one line): 
  3571.        Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, 
  3572.                                 ByVal nCmdShow As Integer) As Integer 
  3573.  3. The following statement is incorrect 
  3574.        GetDC Lib "GDI" (ByVal hWnd As Integer) As Integer 
  3575.     and should be changed to read as follows: 
  3576.        GetDC Lib "USER" (ByVal hWnd As Integer) As Integer 
  3577.     In other words, the function GetDC is in the Windows "USER" 
  3578.     library (DLL), not in the "GDI" library (DLL). 
  3579.  4. The following statement is incorrect 
  3580.        Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, 
  3581.                                 nCmdShow As Integer) As Integer 
  3582.     and should be changed to read as follows: 
  3583.        Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String, 
  3584.                                 ByVal nCmdShow As Integer) As Integer 
  3585.  For more information on WINAPI.TXT, query on the following words: 
  3586.     WINAPI.TXT and Visual and Basic 
  3587. Title: DDE from Visual Basic to Excel for Windows 
  3588. Document Number: Q75089           Publ Date: 21-AUG-1991 
  3589. Product Name: Microsoft Visual Basic 
  3590. Product Version:  1.00 
  3591. Operating System: WINDOWS 
  3592.  
  3593.  Summary: 
  3594.  This article describes how to initiate a dynamic data exchange (DDE) 
  3595.  conversation between a Visual Basic client application and a Microsoft 
  3596.  Excel server application. 
  3597.  This article demonstrates how to: 
  3598.   - Prepare a Microsoft Excel document for active DDE. 
  3599.   - Initiate a cold DDE link (information updated upon request from the 
  3600.     client) between Visual Basic (the client) and Excel (the server). 
  3601.   - Use LinkRequest to update information in Visual Basic (the client) 
  3602.     based on information contained in Excel (the server). 
  3603.   - Initiate a hot DDE link (information updated automatically from 
  3604.     server to client) between Visual Basic (the client) and Excel 
  3605.     (the server). 
  3606.   - Use LinkPoke to send information from Visual Basic (the client) to 
  3607.     Excel (the server). 
  3608.   - Change the LinkMode property between hot and cold. 
  3609.  This information applies to Microsoft Visual Basic programming system 
  3610.  version 1.0 for Windows and to Microsoft Excel for Windows. 
  3611.  More Information: 
  3612.  A client application sends commands through DDE to the server 
  3613.  application to establish a link. Through DDE, the server provides data 
  3614.  to the client at the request of the client or accepts information at 
  3615.  the request of the client. 
  3616.  The steps below serve as a example of how to establish a DDE 
  3617.  conversation between Visual Basic and Excel for Windows. 
  3618.  First, create the server spreadsheet in Excel: 
  3619.  1. Start Excel, and a document titled "SHEET1" will be created by 
  3620.     default. 
  3621.  2. From the File menu, choose Save As, and save the document with the 
  3622.     name SERVER.XLS 
  3623.  4. Exit Excel. For this example to function properly, Excel must not 
  3624.     be loaded and running. 
  3625.  Second, create the client application in Visual Basic: 
  3626.  The client is the application that performs the link operations. It 
  3627.  prompts the server to send information or informs the server that 
  3628.  information is being sent. 
  3629.  1. Start Visual Basic (VB.EXE), and Form1 will be created by default. 
  3630.  2. Create the following controls with the following properties on 
  3631.     Form1: 
  3632.     Default Name     Caption           CtlName 
  3633.     ------------     -------           ------- 
  3634.     Text1            (not applicable)  Text1 
  3635.     Option1          Cold Link         ColdLink 
  3636.     Option2          Hot Link          HotLink 
  3637.     Command1         Poke              Poke 
  3638.     Command2         Request           Request 
  3639.  3. Add the following code to the General Declaration section of Form1: 
  3640.     Const TRUE = -1 
  3641.     Const FALSE = 0 
  3642.     Const HOT = 1 
  3643.     Const COLD = 2 
  3644.     Const NONE = 0 
  3645.  4. Add the following code to the Load event procedure of Form1: 
  3646.  Sub Form_Load () 
  3647.      'This procedure will start Excel and load SERVER.XLS, the 
  3648.      'spreadsheet that was created earlier. 
  3649.      z% = Shell("C:\EXCEL\EXCEL c:\excel\SERVER.XLS", 1) 
  3650.      z% = DoEvents()             'Process Windows events. This ensures 
  3651.                                  'that Excel will be executed before 
  3652.                                  'any attempt is made to perform DDE. 
  3653.      Text1.LinkMode = NONE       'Clears DDE link if it already exists. 
  3654.      Text1.LinkTopic = "Excel]c:\excel\server.xls"     'Sets up link 
  3655.                                                        'with Excel. 
  3656.      Text1.LinkItem = "R1C1"    'Set link to first cell on spreadsheet. 
  3657.      Text1.LinkMode = COLD      'Establish a cold DDE link. 
  3658.      ColdLink.Value = TRUE 
  3659.  End Sub 
  3660.  5. Add the following code to the Click event procedure of the 
  3661.     Cold Link button: 
  3662.  Sub ColdLink_Click () 
  3663.          Request.Visible = TRUE       'Make request button valid. 
  3664.          Text1.LinkMode = NONE        'Clear DDE Link. 
  3665.          Text1.LinkMode = COLD        'Reestablish new LinkMode. 
  3666.  End Sub 
  3667.  6. Add the following code to the Click event procedure of the 
  3668.     Hot Link button: 
  3669.  Sub HotLink_Click () 
  3670.          Request.Visible = FALSE     'No need for button with hot link. 
  3671.          Text1.LinkMode = NONE       'Clear DDE Link. 
  3672.          Text1.LinkMode = HOT        'Reestablish new LinkMode. 
  3673.  End Sub 
  3674.  7. Add the following code to the Click event procedure of the 
  3675.     Request button: 
  3676.  Sub Request_Click () 
  3677.     'With a cold DDE link this button will be visible and when selected 
  3678.     'it will request an update of information from the server 
  3679.     'application to the client application. 
  3680.      Text1.LinkRequest 
  3681.  End Sub 
  3682.  8. Add the following code to the Click event procedure of the Poke 
  3683.     button: 
  3684.  Sub Poke_Click () 
  3685.      'With any DDE link this button will be visible and when selected 
  3686.      'it will poke information from the client application to the 
  3687.      'server application. 
  3688.      Text1.LinkPoke 
  3689.  End Sub 
  3690.  You can now run the Visual Basic client application from the Visual Basic 
  3691.  environment (skip to step 4) or you can save the application and 
  3692.  create an EXE file and run that from Windows (continue to step 1): 
  3693.  1. From the Visual Basic File menu, save the Form and Project with the 
  3694.     name CLIENT. 
  3695.  2. From the File menu, choose Make EXE File, and name it CLIENT.EXE. 
  3696.  3. Exit Visual Basic. 
  3697.  4. Run the application (from Windows if an .EXE file or from the Run 
  3698.     menu if from the Visual Basic environment). 
  3699.  5. Form1 of the client application will be loaded and Excel will 
  3700.     automatically be started with the document SERVER.XLS loaded. 
  3701.  6. Make sure that the main title bar in Excel reads 
  3702.     "Microsoft Excel," NOT "Microsoft Excel - SERVER.XLS." If the title 
  3703.     bar is improper, then from the Window menu choose ArrangeAll. 
  3704.  You can now experiment with DDE between Visual Basic and Excel: 
  3705.  1. Try typing in some text in R1C1 in the spreadsheet and then 
  3706.     select the Request button. The text appears in the text box. 
  3707.  2. Choose Hot Link and then type in some more text in R1C1 of the 
  3708.     spreadsheet. The text is automatically updated in the Visual 
  3709.     Basic text box. 
  3710.  3. Type some text in the text box in the Visual Basic application and 
  3711.     select the Poke button. The text is sent to R1C1 in the Excel 
  3712.     spreadsheet. 
  3713.  Note that if you have "Ignore Remote Requests" checked in the 
  3714.  "Options" - "Work space" menu, you will not be able to establish DDE 
  3715.  from Visual Basic. Make sure that "Ignore Remote Requests" is NOT checked. 
  3716.  You can also establish DDE between applications at design time. This 
  3717.  is covered on page 356 in the "Microsoft Visual Basic: Programmer's 
  3718.  Guide" version 1.0 manual. 
  3719.  For additional information on dynamic data exchange (DDE) between 
  3720.  Microsoft Visual Basic version 1.0 and other Windows applications, 
  3721.  query on the following words: 
  3722.     DDE and Visual Basic 
  3723. Title: DDE Between Visual Basic and Q+E for Windows 
  3724. Document Number: Q75090           Publ Date: 21-AUG-1991 
  3725. Product Name: Microsoft Visual Basic 
  3726. Product Version:  1.00 
  3727. Operating System: WINDOWS 
  3728.  
  3729.  Summary: 
  3730.  This article describes how to initiate a dynamic data exchange (DDE) 
  3731.  conversation between a Visual Basic client application and a Q+E 
  3732.  server application. 
  3733.  This article demonstrates how to: 
  3734.  1. Prepare a Q+E database file for active DDE. 
  3735.  2. Initiate a cold DDE link (information updated upon request from the 
  3736.     client) between Visual Basic (the client) and Q+E (the server). 
  3737.  3. Use LinkRequest to update information in Visual Basic (the client) 
  3738.     based on information contained in Q+E (the server). 
  3739.  4. Initiate a hot DDE link (information updated automatically from 
  3740.     server to client) between Visual Basic (the client) and Q+E (the 
  3741.     server). 
  3742.  5. Use LinkPoke to send information from Visual Basic (the client) to 
  3743.     Q+E (the server). 
  3744.  6. Change the LinkMode property between hot and cold. 
  3745.  This information applies to Microsoft Visual Basic programming system 
  3746.  version 1.0 for Windows and to Pioneer Software Q+E (a database query 
  3747.  tool). 
  3748.  More Information: 
  3749.  A client application sends commands through DDE to the server 
  3750.  application to establish a link. Through DDE, the server provides data 
  3751.  to the client at the request of the client or accepts information at 
  3752.  the request of the client. 
  3753.  The following steps serve as a example of how to establish a DDE 
  3754.  conversation between Visual Basic and Pioneer Software Q+E for Windows. 
  3755.  First, generate a Q+E database file to act as the server. 
  3756.  1. Create a database (.DBF) file (see the Q+E manuals for the 
  3757.     procedure). For this example, you will use one of the default 
  3758.     files, ADDR.DBF, that was provided with Excel for Windows. 
  3759.  2. If Q+E is already running, exit Q+E. For this example to work 
  3760.     properly, Q+E must not be loaded and running. 
  3761.  Next, create the client application in Visual Basic. 
  3762.  The client is the application that performs the link operations. It 
  3763.  prompts the server to send information or informs the server that 
  3764.  information is being sent. 
  3765.  1. Start Visual Basic. Form1 will be created by default. 
  3766.  2. Create the following controls with the following properties on 
  3767.     Form1: 
  3768.     Default Name     Caption            CtlName 
  3769.     ------------     -------            ------- 
  3770.     Text1            (not applicable)   Text1 
  3771.     Option1          Cold Link          ColdLink 
  3772.     Option2          Hot Link           HotLink 
  3773.     Command1         Poke               Poke 
  3774.     Command2         Request            Request 
  3775.  3. Add the following code to the General Declaration section of Form1: 
  3776.     Const TRUE = -1 
  3777.     Const FALSE = 0 
  3778.     Const HOT = 1 
  3779.     Const COLD = 2 
  3780.     Const NONE = 0 
  3781.  4. Add the following code to the Load event procedure of Form1: 
  3782.  Sub Form_Load ()        'This procedure will start Q+E and load the 
  3783.                          'file "ADDR.DBF" 
  3784.      z% = Shell("C:\EXCEL\QE C:\EXCEL\QE\ADDR.DBF",1) 
  3785.      z% = DoEvents ()                'Process Windows events. This 
  3786.                                      'ensures that Q+E will be 
  3787.                                      'executed before any attempt is 
  3788.                                      'made to perform DDE with it. 
  3789.      Text1.LinkMode = NONE           'Clears DDE link if it already 
  3790.                                      'exists. 
  3791.      Text1.LinkTopic = "QE]QUERY1"   'Sets up link with Q+E. 
  3792.      Text1.LinkItem = "R1C1"         'Set link to first cell on 
  3793.                                      'spreadsheet. 
  3794.      Text1.LinkMode = COLD           'Establish a cold DDE link. 
  3795.      ColdLink.Value = TRUE 
  3796.  End Sub 
  3797.  5. Add the following code to the Click event procedure of the 
  3798.     Cold Link button: 
  3799.  Sub ColdLink_Click () 
  3800.          Request.Visible = TRUE       'Make request button valid. 
  3801.          Text1.LinkMode = NONE        'Clear DDE Link. 
  3802.          Text1.LinkMode = COLD        'Reestablish new LinkMode. 
  3803.  End Sub 
  3804.  6. Add the following code to the Clink event procedure of the 
  3805.     Hot Link button: 
  3806.  Sub HotLink_Click () 
  3807.          Request.Visible = FALSE     'No need for button with hot link. 
  3808.          Text1.LinkMode = NONE       'Clear DDE Link. 
  3809.          Text1.LinkMode = HOT        'Reestablish new LinkMode. 
  3810.  End Sub 
  3811.  7. Add the following code to the Click event procedure of the 
  3812.     Request button: 
  3813.  Sub Request_Click () 
  3814.      'With a cold DDE link this button will be visible and when 
  3815.      'selected it will request an update of information from the server 
  3816.      'application to the client application. 
  3817.      Text1.LinkRequest 
  3818.  End Sub 
  3819.  8. Add the following code to the Click event procedure of the Poke 
  3820.     button: 
  3821.  Sub Poke_Click () 
  3822.      'With any DDE link this button will be visible and when selected 
  3823.      'it will poke information from the client application to the 
  3824.      'server application. 
  3825.      Text1.LinkPoke 
  3826.  End Sub 
  3827.  You can now run the Visual Basic client application from the Visual 
  3828.  Basic environment (skip to step 4) or you can save the application and 
  3829.  create an .EXE file and run that from Windows (continue to step 1): 
  3830.  1. From the File menu, save the Form and Project using the name 
  3831.     CLIENT. 
  3832.  2. From the File menu, choose Make an EXE File, and name it 
  3833.     CLIENT.EXE. 
  3834.  3. Exit Visual Basic. 
  3835.  4. Run the application (from Windows if an .EXE file or from the Run 
  3836.     menu if from the Visual Basic environment). 
  3837.  5. Form1 of the client application will be loaded and Q+E will 
  3838.     automatically be started with the database file ADDR.DBF loaded. 
  3839.  6. Make sure that the main title bar in Q+E reads "Q + E," NOT 
  3840.     "Q + E - ADDR.DBF." If the title bar is incorrect, then from the 
  3841.     Window menu of Q+E choose ArrangeAll. 
  3842.  You can now experiment with DDE between Visual Basic and Q+E for 
  3843.  Windows: 
  3844.  1. Try typing in some text in R1C1 (the cell that holds the name 
  3845.     "Tyler") in the Q+E spreadsheet and then select the Request button. 
  3846.     The text will appear in the Visual Basic text box. 
  3847.  2. Choose Hot Link and then type in some more text in R1C1 of the Q+E 
  3848.     spread sheet. The text is automatically updated in the Visual Basic 
  3849.     text box. 
  3850.  3. Type some text in the text box in the Visual Basic application and 
  3851.     select the Poke button. The text is sent to R1C1 in the Q+E 
  3852.     spreadsheet. 
  3853.  Note that if you do not have the Allow Editing option checked under 
  3854.  the Edit menu in Q+E, you will not be able to change the contents of 
  3855.  the Q+E spreadsheet. This may prevent some DDE operations. For 
  3856.  example, attempting to LinkPoke to Q+E from Visual Basic when the 
  3857.  Allow Editing option is not selected will cause the program to crash 
  3858.  and result in a "Foreign application won't perform DDE method or 
  3859.  operation" error message. Attempting to change the contents of the 
  3860.  spreadsheet from Q+E will result in a "Use the allow editing command 
  3861.  before making changes" error message. From the Edit menu of Q+E, 
  3862.  select Allow Editing to enable this option. When viewed from the edit 
  3863.  menu, it should have a check mark next to it when enabled. 
  3864.  You can also establish DDE between applications at design time. For 
  3865.  more information, see page 356 of the "Microsoft Visual Basic: 
  3866.  Programmer's Guide" version 1.0 manual. 
  3867.  For additional information on dynamic data exchange (DDE) between 
  3868.  Microsoft Visual Basic version 1.0 and other Windows applications, 
  3869.  query on the following words: 
  3870.     DDE and Visual Basic 
  3871. Title: Cannot Make DDE Link to Object as Child of Another Object 
  3872. Document Number: Q75091           Publ Date: 21-AUG-1991 
  3873. Product Name: Microsoft Visual Basic 
  3874. Product Version:  1.00 
  3875. Operating System: WINDOWS 
  3876.  
  3877.  Summary: 
  3878.  When performing dynamic data exchange (DDE) from a client application 
  3879.  to a Visual Basic server application, you cannot make a DDE 
  3880.  link to an object that is not a direct child of a Form in the Visual 
  3881.  Basic application. 
  3882.  For example, from Excel you cannot establish a DDE link with a text 
  3883.  box in a Visual Basic application if that text box is contained within 
  3884.  a picture box on Form1. 
  3885.  The text box must be on Form1 and not a child of any other object on 
  3886.  that form. 
  3887.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  3888.  programming system version 1.0 for Windows. Microsoft is researching 
  3889.  this problem and will post new information here as it becomes 
  3890.  available. 
  3891.  More Information: 
  3892.  To work around this problem, create an additional object on the form 
  3893.  and set that object's Visible property to False. You can then 
  3894.  establish a DDE link with this hidden object. 
  3895.  Establishing a DDE link with a hidden object will issue the Change 
  3896.  event for this object. You can attach code to this event that will 
  3897.  update the information sent via the DDE link to the appropriate 
  3898.  control, which may or may not be a direct child of the form. 
  3899.  The following example demonstrates this workaround: 
  3900.  First, create the server application in Visual Basic: 
  3901.  1. Start Visual Basic, and Form1 will be created by default. 
  3902.  2. Put a text box (Text1) on Form1. 
  3903.  3. Save the Form and Project with the name SERVER. 
  3904.  4. From the File menu, choose Make EXE File, make an .EXE, and call it 
  3905.     SERVER.EXE. 
  3906.  Next, create the client application in Visual Basic: 
  3907.  1. From the File menu, choose New Project. Form1 will be created by 
  3908.     default. 
  3909.  2. Put a picture box (Picture1) on Form1. 
  3910.  3. Put a text box (Text1) in the picture box (Picture1) as follows: 
  3911.     a. Click ONCE on the text box icon in the toolbox. 
  3912.     b. Move the mouse pointer on top of Picture1 (note the mouse 
  3913.        pointer is a cross). 
  3914.     c. Press the left mouse button and drag the mouse pointer to 
  3915.        size the text box. 
  3916.     d. Release the left mouse button. 
  3917.     e. Text1 is now a child of Picture1. 
  3918.  4. Put a text box (Text2) on Form1. 
  3919.  5. Set the Visible property of Text2 to False. 
  3920.  6. Add the following code to the General Declaration section of Form1: 
  3921.     Const NONE = 0 
  3922.     Const HOT = 1 
  3923.  7. Add the following code to the Form_Load event procedure of Form1: 
  3924.  Sub Form_Load () 
  3925.       'This procedure will start the Visual Basic server application 
  3926.       'that was created earlier. 
  3927.       Form1.Show         'Show Form1 
  3928.       z% = Shell("C:\VB\SERVER,1) 
  3929.       z% = DoEvents()    'Causes Windows to process the Shell. 
  3930.       Text2.LinkMode = NONE      'Clears DDE Link if already there. 
  3931.       Text2.LinkTopic = "Server]Form1"    'Sets up link with VB server. 
  3932.       Text2.LinkItem = "Text1"   'Sets link to Text Box on server. 
  3933.       Text2.LinkMode = HOT       'Establish a hot DDE link. 
  3934.  End Sub 
  3935.  8. Add the following code to the Change event procedure of Text1: 
  3936.  Sub Text2_Change () 
  3937.       'This procedure will cause the information in the text field of 
  3938.       'Text1 to be updated whenever the text property of Text2 changes. 
  3939.       Text1.Text = Text2.Text 
  3940.  End Sub 
  3941.  You can now run the VB client application: 
  3942.  1. From the Run menu, choose Start. 
  3943.  2. Form1 of the client application will be loaded and the Visual Basic 
  3944.     server application will automatically be started. 
  3945.  3. Now any information you type in the text box of the Server 
  3946.     application will be automatically updated to the invisible text box 
  3947.     (on Form1) in the client application and then automatically 
  3948.     transferred to the Visible text box (on Picture1 on Form1) in the 
  3949.     client application. 
  3950. Title: Duplicate PostScript Font Names in VB Printer.Fonts List 
  3951. Document Number: Q75092           Publ Date: 21-AUG-1991 
  3952. Product Name: Microsoft Visual Basic 
  3953. Product Version:  1.00 
  3954. Operating System: WINDOWS 
  3955.  
  3956.  Summary: 
  3957.  When a PostScript printer driver is active in Microsoft Windows 3.0, 
  3958.  the Fonts(index%) property of Visual Basic's Printer object may return 
  3959.  one or more duplicate font names at run time. This problem is caused 
  3960.  by Microsoft Windows 3.0 itself (and is not caused by Microsoft Visual 
  3961.  Basic programming system version 1.0 for Windows). 
  3962.  Microsoft has confirmed this to be a problem with Microsoft Windows 
  3963.  version 3.0 (buglist3.00). We are researching this problem and will 
  3964.  post new information here as it becomes available. 
  3965.  More Information: 
  3966.  The following program displays the list of font names available for 
  3967.  the PostScript printer currently selected in the Windows Control Panel: 
  3968.  Sub Form_Click () 
  3969.     For J% = 0 to Printer.FontCount - 1 
  3970.     Print Printer.Fonts(J%) 
  3971.     Next J% 
  3972.  End Sub 
  3973.  In some cases, when a PostScript printer is active in Windows, one or 
  3974.  more fonts are listed twice. 
  3975. Title: Some Invalid DrawMode Values Return 1-16 Instead of Error 
  3976. Document Number: Q75174           Publ Date: 21-AUG-1991 
  3977. Product Name: Microsoft Visual Basic 
  3978. Product Version:  1.00 
  3979. Operating System: WINDOWS 
  3980.  
  3981.  Summary: 
  3982.  The Microsoft Visual Basic DrawMode property will not give an error 
  3983.  for some invalid values. For example, numbers in the range 257 to 272, 
  3984.  513 to 528, and so forth, and for negative numbers in the range -240 
  3985.  to -255, -496 to -511, and so forth. 
  3986.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  3987.  programming system version 1.0 for Windows. We are researching this 
  3988.  problem and will post new information here as it becomes available. 
  3989.  More Information: 
  3990.  The code below demonstrates the problem. When you run this program, 
  3991.  the DrawMode is assigned to 257, and when the DrawMode is printed, it 
  3992.  prints 1, showing that the values are mapping onto 1 through 16. 
  3993.  Example 
  3994.  ------- 
  3995.  1. In the VB.EXE environment, create a New Form. 
  3996.  2. In the Form_GotFocus event procedure, add the following lines of 
  3997.     code: 
  3998.        DrawMode = 257 
  3999.        Print DrawMode 
  4000.  3. Run the program (press F5). The program will incorrectly display a 
  4001.     1 on the form, instead of giving the error message "Illegal 
  4002.     Property Value." 
  4003.  By analyzing the range of values that map onto 1 through 16, any 
  4004.  number that satisfies the following equation will not generate an 
  4005.  error, but will instead give values in the range of 1 to 16: 
  4006.     Number = (x * 256) + y 
  4007.  where x is a whole number between -128 and 127, and y is between 1 and 
  4008.  16 inclusive (that is, any number in the range of a multiple of 256 
  4009.  plus 1 to 16 will map onto 1 through 16). 
  4010. Title: Using Code Menu's Replace to Create Subs May Fail in VB.EXE 
  4011. Document Number: Q75057           Publ Date: 22-AUG-1991 
  4012. Product Name: Microsoft Visual Basic 
  4013. Product Version:  1.00 
  4014. Operating System: WINDOWS 
  4015.  
  4016.  Summary: 
  4017.  When using the Replace command from the Code menu of Microsoft 
  4018.  Visual Basic to perform a replacement that results in the creation of 
  4019.  a Sub or Function, Visual Basic may not correctly perform the 
  4020.  replacement. 
  4021.  Microsoft has confirmed this to be a problem in Microsoft Visual Basic 
  4022.  programming system version 1.0 for Windows. Microsoft is researching 
  4023.  this problem and will post new information here as it becomes 
  4024.  available. 
  4025.  More Information: 
  4026.  Steps to Reproduce Problem 
  4027.  -------------------------- 
  4028.  1. Start the Visual Basic environment (VB.EXE). 
  4029.  2. Double-click on Form1 to bring up a code window. 
  4030.  3. Select the (general) object from the object list box at the top of 
  4031.     the code window. 
  4032.  4. Type the following text in the code window: 
  4033.        'test1 
  4034.        'test2 
  4035.        'test3 
  4036.        'test4 
  4037.  5. From the Code menu, choose the Replace command. 
  4038.  6. Type the following on the "Find What:" line of the Replace dialog 
  4039.     box: 
  4040.        'test 
  4041.  7. Type the following on the "Replace With:" line of the same dialog 
  4042.     box: 
  4043.        sub test 
  4044.  8. If you now choose the Verify button, Visual Basic will prompt you 
  4045.     to replace the text for the lines 'test1 and 'test3, but not for 
  4046.     'test2 or 'test4. If you choose Replace All, Visual Basic will 
  4047.     correctly create Sub test1 and Sub test2, but will fail to replace 
  4048.     the text for 'test3 or 'test4. (The order of replacement 
  4049.     depends upon the location of the insertion point.) 
  4050. Title: How to Determine Multiple Instances of a VB Application 
  4051. Document Number: Q75641           Publ Date:  9-SEP-1991 
  4052. Product Name: Microsoft Visual Basic 
  4053. Product Version:  1.00 
  4054. Operating System: WINDOWS 
  4055.  
  4056.  Summary: 
  4057.  Using Windows version 3.0 API function calls, you can determine if 
  4058.  another instance of your application is running. Using the same API 
  4059.  calls, you can also determine how many instances of an application are 
  4060.  running. 
  4061.  This information applies to Microsoft Visual Basic programming system 
  4062.  version 1.0 for Windows. 
  4063.  More Information: 
  4064.  You can use two Windows API function calls to determine how many 
  4065.  instances of your application are running. This can be useful if you 
  4066.  want to limit how many copies of your application can run at once. 
  4067.  The Windows KERNEL DLL (dynamic-link library) defines two functions 
  4068.  called GetModuleHandle and GetModuleUsage. GetModuleUsage uses the 
  4069.  handle returned from GetModuleHandle to determine how many instances 
  4070.  of your application are running. Below is a definition of each 
  4071.  function: 
  4072.  GetModuleHandle%(lpProgramName$) 
  4073.  -------------------------------- 
  4074.  This function retrieves the program handle of the specified program. 
  4075.     lpProgramName$  Points to a null-terminated character string that 
  4076.                     specifies the program. 
  4077.     Return Value    The return value identifies the program if the 
  4078.                     function is successful. Otherwise, the return value is 
  4079.                     zero. 
  4080.  GetModuleUsage%(hProgram%) 
  4081.  -------------------------- 
  4082.  This function returns the reference count of a specified program. 
  4083.     hProgram%       Identifies the program or an instance of the program. 
  4084.                     This value can be determined with a call to 
  4085.                     GetModuleHandle. 
  4086.     Return Value    The return value specifies the reference count of 
  4087.                     the program. 
  4088.  Example 
  4089.  ------- 
  4090.  The following application is an example of how to limit an application 
  4091.  to a single instance: 
  4092.  1. Create a form called Form1. 
  4093.  2. Within the global-declaration section of the form, declare the 
  4094.     following Windows API functions: 
  4095.     Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpProgramName$) 
  4096.     Declare Function GetModuleUsage% Lib "Kernel" (ByVal hProgram%) 
  4097.  3. Within the Form_Load event add the following code: 
  4098.     Sub Form_Load () 
  4099.        hw% = GetModuleHandle("project.EXE") 
  4100.        If GetModuleUsage(hw%) > 1 Then 
  4101.           MsgBox "This program is already loaded!", 16 
  4102.           End 
  4103.        End If 
  4104.     End Sub 
  4105.  4. Compile the program as PROJECT.EXE 
  4106.  5. Run PROJECT.EXE from the Program Manager. 
  4107.  6. Run a second instance of PROJECT.EXE. It should display a message 
  4108.     box and terminate. 
  4109.  Reference: 
  4110.  "Programming Windows: the Microsoft Guide to Writing Applications for 
  4111.  Windows 3," by Charles Petzold (published by Microsoft Press, 1990) 
  4112.  "Microsoft Windows 3.0 Software Development Kit: Reference Volume 1" 
  4113.  WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  4114.  Development Kit 
  4115. Title: Text Not Highlighted Copying Immediate Window to Clipboard 
  4116. Document Number: Q75762           Publ Date:  9-SEP-1991 
  4117. Product Name: Microsoft Visual Basic 
  4118. Product Version:  1.00 
  4119. Operating System: WINDOWS 
  4120.  
  4121.  Summary: 
  4122.  When you copy text from the Immediate window to the Windows system 
  4123.  clipboard, the selected text is not highlighted. Also, the cursor is 
  4124.  not visible. However, the copy operation works as it should. 
  4125.  This information applies to Microsoft Visual Basic programming system 
  4126.  version 1.0 for windows. 
  4127.  Microsoft has confirmed this problem in Microsoft Visual Basic 
  4128.  programming system version 1.0 for Windows. We are researching this 
  4129.  problem and will post new information here as it becomes available. 
  4130.  More Information: 
  4131.  To reproduce the problem, perform the following steps: 
  4132.  1. Run the Windows Clipboard utility. (Usually found in the Windows 
  4133.     MAIN group window). 
  4134.  2. Run Visual Basic. 
  4135.  3. Press F5 to start Visual Basic. 
  4136.  4. Press CTRL+BREAK to bring up the Immediate window. 
  4137.  5. Press F5 to continue. 
  4138.  6. Click on the Immediate window to give it the focus. 
  4139.  7. Press CTRL+HOME to move to the beginning of the text in the 
  4140.     Immediate window. 
  4141.  8. Press SHIFT+CTRL+END (this selects all text in the Immediate 
  4142.     window. Note that you cannot select text with the Mouse at this 
  4143.     point). 
  4144.  9. Press CTRL+INS (this copies the selected text in the Immediate 
  4145.     window to the Windows clipboard). 
  4146.  The text transfers to the Windows clipboard as it should, but the text 
  4147.  in the Immediate window is not highlighted as it should be. The cursor 
  4148.  is also not visible. 
  4149. Title: How to Print the ASCII Character Set in Visual Basic 
  4150. Document Number: Q75857           Publ Date:  9-SEP-1991 
  4151. Product Name: Microsoft Visual Basic 
  4152. Product Version:  1.00 
  4153. Operating System: WINDOWS 
  4154.  
  4155.  Summary: 
  4156.  The default font used by Visual Basic is the standard ANSI character 
  4157.  set. To display the ASCII character set, which is more commonly used 
  4158.  by DOS mode applications, you must call two different Windows API 
  4159.  functions. The Windows API functions are GetStockObject and 
  4160.  SelectObject. 
  4161.  This information applies to Microsoft Visual Basic programming system 
  4162.  version 1.0 for Windows. 
  4163.  More Information: 
  4164.  Windows supports a second character set, referred to as the OEM 
  4165.  character set. This is generally the character set used internally by 
  4166.  DOS for screen display at the DOS prompt. The character codes 32 to 
  4167.  127 are normally identical for the OEM, ASCII, and ANSI character 
  4168.  sets. The ANSI characters represented by the remaining character codes 
  4169.  (codes 0 to 31 and 128 to 255) are generally different from characters 
  4170.  represented by the OEM and ASCII character sets. The OEM and ASCII 
  4171.  character sets are identical for these ranges. Under the ASCII and OEM 
  4172.  character sets, the character codes 128 to 255 correspond to the 
  4173.  extended ASCII character set, which includes line drawing characters, 
  4174.  "graphics" characters, and special symbols. The characters represented 
  4175.  by this range of character codes generally differ between the ASCII 
  4176.  (or OEM) and ANSI character sets. 
  4177.  To change the selected font from ANSI to the OEM ASCII font, you must 
  4178.  get a handle to the OEM character set by calling GetStockObject. When 
  4179.  this handle is passed as an argument to SelectObject, the ANSI font 
  4180.  will be replaced by the OEM ASCII font. This API function also returns 
  4181.  the handle to the font object previously used. Once you are through 
  4182.  displaying the desired characters, you should call SelectObject again 
  4183.  to reselect the original font object. 
  4184.  Note: There is also an API function called DeleteObject. This function 
  4185.  need not be called to delete a stock object. The purpose of this API 
  4186.  function is to delete objects loaded with the API function GetObject. 
  4187.  The three functions are described as follows: 
  4188.  GetStockObject% (nIndex%) 
  4189.  ------------------------- 
  4190.  nIndex% 
  4191.     Specifies the type of stock object desired. Use the constant 
  4192.     OEM_FIXED_FONT to retrieve the handle to the OEM character set. 
  4193.     The value of this constant is 10. 
  4194.  Return Value 
  4195.     The return value identifies the desired logical object if the 
  4196.     function is successful. Otherwise, it is NULL. 
  4197.  SelectObject% (hDC%, hObject%) 
  4198.  ------------------------------ 
  4199.  hDC% 
  4200.     Identifies the device context. 
  4201.  hObject% 
  4202.     Identifies the object to be selected. Use the return value from 
  4203.     GetStockObject% (above) to select the OEM character set. 
  4204.  Return Value 
  4205.     The return value identifies the handle to the object previously 
  4206.     used. This value should be saved in a variable such that 
  4207.     SelectObject can be called again to restore the original object 
  4208.     used. It is NULL if there is an error. 
  4209.  The following steps describe how to create a program example that 
  4210.  demonstrates how to print ASCII characters. 
  4211.  1. Run Visual Basic. 
  4212.  2. From the File menu, choose New Project (ALT, F, N). 
  4213.  3. Create a command button called Command1 on the default form 
  4214.     (Form1). 
  4215.  4. Add the following declarations to the General Declarations section 
  4216.     of Form1. 
  4217.     Declare Function GetStockObject% Lib "GDI" (ByVal nIndex%) 
  4218.     Declare Function SelectObject% Lib "GDI" (ByVal hdc%, ByVal hObject%) 
  4219.  5. Place the following code in the Command1 click event procedure: 
  4220.  Sub Command1_Click () 
  4221.      Const OEM_FIXED_FONT = 10 
  4222.      Const PIXEL = 3 
  4223.      Dim hOEM As Integer      '* handle to the OEM font object 
  4224.      Dim Y, H As Single 
  4225.      '* save the scale mode so that you can reset later 
  4226.      Saved% = Form1.ScaleMode 
  4227.      Form1.ScaleMode = PIXEL 
  4228.      '* Get the character height and subtract the external leading 
  4229.      H = Form1.TextHeight(Chr$(200)) - 1 
  4230.      '* get the handle to the desired font 
  4231.      hOEM = GetStockObject(OEM_FIXED_FONT) 
  4232.      '* select the object relating to the font handle, if 
  4233.      '* successful then print the desired characters. 
  4234.      PreviousObject% = SelectObject(Form1.hDC, hOEM) 
  4235.      If PreviousObject% Then 
  4236.          Form1.CurrentX = 10: Form1.CurrentY = 10 
  4237.          Print Chr$(201); Chr$(187); 
  4238.          Form1.CurrentX = 10: 
  4239.          Form1.CurrentY = Form1.CurrentY + H 
  4240.          Print Chr$(200); Chr$(188) 
  4241.          '* Reinstate previous font 
  4242.          hOEM = SelectObject(Form1.hDC, PreviousObject%) 
  4243.      Else 
  4244.          '* SelectObject was unsuccessful 
  4245.          MsgBox "Couldn't find OEM fonts", 48 
  4246.      End If 
  4247.      '* reset the scale mode 
  4248.      Form1.ScaleMode = Saved% 
  4249.  End Sub 
  4250.  6. From the Run menu, choose Start. 
  4251.  7. Click the Command1 button. 
  4252.  When the Command1 button is clicked or selected, a small box with a 
  4253.  double border will be drawn in the upper-left corner of the screen. 
  4254.  The box is drawn using characters associated with the extended ASCII 
  4255.  character set. 
  4256.  References: 
  4257.  1. "Programming Windows: the Microsoft Guide to Writing Applications 
  4258.     for Windows 3," by Charles Petzold (published by Microsoft Press, 
  4259.     1990) 
  4260.  2. "Peter Norton's Windows 3.0 Power Programming Techniques," by 
  4261.     Peter Norton & Paul Yao (published by Bantam Computer Books, 1990) 
  4262.  3. "Microsoft Windows 3.0 Software Development Kit: Reference 
  4263.     Volume 1" 
  4264.  4. The WINSDK.HLP file shipped with Microsoft Windows 3.0 Software 
  4265.     Development Kit. 
  4266. Title: Simulating ON KEY Key Trapping with KeyDown Event in VB 
  4267. Document Number: Q75858           Publ Date:  9-SEP-1991 
  4268. Product Name: Microsoft Visual Basic 
  4269. Product Version:  1.00 
  4270. Operating System: WINDOWS 
  4271.  
  4272.  Summary: 
  4273.  Although there is no ON KEY GOSUB statement in Visual Basic, the 
  4274.  effect of ON KEY event handling can be achieved in Visual Basic. 
  4275.  Visual Basic forms and controls that are able to get focus within 
  4276.  Visual Basic have a [form/control|_KeyDown event procedure that can 
  4277.  simulate the effects of the ON KEY statements of DOS-based Basics. The 
  4278.  process of using the KeyDown is more powerful and more flexible than 
  4279.  the ON KEY statement. 
  4280.  This information applies to the Microsoft Visual Basic programming 
  4281.  system version 1.0 for Windows. 
  4282.  More Information: 
  4283.  If you press a key while one of your Visual Basic forms or controls 
  4284.  has the focus, the KeyDown event procedure for that form or control 
  4285.  will be executed. Within the KeyDown event procedure, you can call a 
  4286.  global procedure and pass the actual key states to the global 
  4287.  procedure to create the same effect as the ON KEY event trapping that 
  4288.  is performed in the DOS-based Basic. 
  4289.  You can also pass the control or form where the KeyDown occurred to 
  4290.  the global procedure. Passing the control or form itself will allow 
  4291.  the global procedure to tell what control or form called the global 
  4292.  procedure. 
  4293.  To create a small example, perform the following steps: 
  4294.  1. Within Visual Basic's Project window, double-click the GLOBAL.BAS 
  4295.     file to bring up the code window. From Visual Basic's Code menu, 
  4296.     choose "Load text...". Load the CONSTANTS.TXT file that came with 
  4297.     Visual Basic. Note: If you already have text within the GLOBAL.BAS 
  4298.     file, you will need to create another module, add the CONSTANTS.TXT 
  4299.     to this file, and then cut and paste to the GLOBAL.BAS file. 
  4300.  2. Create two text boxes on a form. 
  4301.  3. In the Text1_KeyDown event procedure, add the following code: 
  4302.        Call OnKeyGoSub(KeyCode, Shift, Text1) 
  4303.  4. In the Text2_KeyDown event procedure, add the following code: 
  4304.        Call OnKeyGoSub(KeyCode, Shift, Text2) 
  4305.  5. Add a Label to Form1 called Label1. 
  4306.  6. At the global-declaration section for form1, add the following 
  4307.     procedure: 
  4308.     Sub OnKeyGoSub (KeyCode%, Shift%, Ctrl As Control) 
  4309.        Select Case KeyCode% 
  4310.           Case KEY_MENU: Key$ = "" 
  4311.           Case KEY_SHIFT: Key$ = "" 
  4312.           Case KEY_CONTROL: Key$ = "" 
  4313.           Case KEY_F1: Key$ = " F1 " 
  4314.           Case KEY_UP: Key$ = " UP key" 
  4315.           Case KEY_CAPITAL: Key$ = "CAP LOCKS" 
  4316.           Case Else: Key$ = Chr$(KeyCode%) 
  4317.        End Select 
  4318.        Select Case Shift% 
  4319.           Case SHIFT_MASK: Shft$ = "Shift" 
  4320.           Case ALT_MASK: Shft$ = "Alt" 
  4321.           Case CTRL_MASK: Shft$ = "Ctrl" 
  4322.           Case Else: Shft$ = "" 
  4323.        End Select 
  4324.        ControlName$ = Ctrl.CtrlName 
  4325.        Label1.Caption="Key:"+ Shft$+ " "+ Key$+" from "+ ControlName$ 
  4326.     End Sub 
  4327.  7. Run the program. Move back and forth between the two text boxes 
  4328.     using either the TAB key or the mouse. Experiment with any key in 
  4329.     combination with the ALT, CTRL, and SHIFT keys. Also try the F1 key 
  4330.     and the UP ARROW key. 
  4331.  This example is limited but shows how you could simulate the ON KEY 
  4332.  statements or key trapping within Visual Basic. Placing the call to 
  4333.  the key trap procedure within any KeyDown event procedure will 
  4334.  simulate the ON KEY statement. 
  4335.